Class ClassPathProcessApplicationScanner

  • All Implemented Interfaces:
    ProcessApplicationScanner

    public class ClassPathProcessApplicationScanner
    extends java.lang.Object
    implements ProcessApplicationScanner

    Scans for bpmn20.xml files in the classpath of the given classloader.

    Scans all branches of the classpath containing a META-INF/processes.xml file

    Author:
    Daniel Meyer, Falko Menge
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addResource​(java.lang.Object source, java.util.Map<java.lang.String,​byte[]> resourceMap, java.lang.String resourceRootPath, java.lang.String resourceName)  
      java.util.Map<java.lang.String,​byte[]> findResources​(java.lang.ClassLoader classLoader, java.lang.String paResourceRootPath, java.net.URL metaFileUrl)  
      java.util.Map<java.lang.String,​byte[]> findResources​(java.lang.ClassLoader classLoader, java.lang.String paResourceRootPath, java.net.URL metaFileUrl, java.lang.String[] additionalResourceSuffixes)  
      protected void handleArchive​(java.io.File file, java.lang.String paResourceRootPath, java.lang.String[] additionalResourceSuffixes, java.util.Map<java.lang.String,​byte[]> resourceMap)  
      protected void handleDirectory​(java.io.File directory, java.lang.String rootPath, java.lang.String localPath, java.lang.String paResourceRootPath, boolean isPaLocal, java.lang.String[] additionalResourceSuffixes, java.util.Map<java.lang.String,​byte[]> resourceMap)  
      protected boolean isBelowPath​(java.lang.String processFileName, java.lang.String paResourceRootPath)  
      protected java.util.Enumeration<java.net.URL> loadClasspathResourceRoots​(java.lang.ClassLoader classLoader, java.lang.String strippedPaResourceRootPath)  
      void scanPaResourceRootPath​(java.lang.ClassLoader classLoader, java.net.URL metaFileUrl, java.lang.String paResourceRootPath, java.lang.String[] additionalResourceSuffixes, java.util.Map<java.lang.String,​byte[]> resourceMap)  
      void scanPaResourceRootPath​(java.lang.ClassLoader classLoader, java.net.URL metaFileUrl, java.lang.String paResourceRootPath, java.util.Map<java.lang.String,​byte[]> resourceMap)  
      protected void scanPath​(java.lang.String urlPath, java.lang.String paResourceRootPath, boolean isPaLocal, java.lang.String[] additionalResourceSuffixes, java.util.Map<java.lang.String,​byte[]> resourceMap)  
      protected void scanUrl​(java.net.URL url, java.lang.String paResourceRootPath, boolean isPaLocal, java.lang.String[] additionalResourceSuffixes, java.util.Map<java.lang.String,​byte[]> resourceMap)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassPathProcessApplicationScanner

        public ClassPathProcessApplicationScanner()
    • Method Detail

      • findResources

        public java.util.Map<java.lang.String,​byte[]> findResources​(java.lang.ClassLoader classLoader,
                                                                          java.lang.String paResourceRootPath,
                                                                          java.net.URL metaFileUrl)
        Specified by:
        findResources in interface ProcessApplicationScanner
        Parameters:
        classLoader - the classloader to scan
        paResourceRootPath - see ProcessArchiveXml.PROP_RESOURCE_ROOT_PATH
        metaFileUrl - the URL to the META-INF/processes.xml file
        Returns:
        a Map of process definitions
      • findResources

        public java.util.Map<java.lang.String,​byte[]> findResources​(java.lang.ClassLoader classLoader,
                                                                          java.lang.String paResourceRootPath,
                                                                          java.net.URL metaFileUrl,
                                                                          java.lang.String[] additionalResourceSuffixes)
        Specified by:
        findResources in interface ProcessApplicationScanner
        Parameters:
        classLoader - the classloader to scan
        paResourceRootPath - see ProcessArchiveXml.PROP_RESOURCE_ROOT_PATH
        metaFileUrl - the URL to the META-INF/processes.xml file
        additionalResourceSuffixes - a list of additional suffixes for resources
        Returns:
        a Map of process definitions
      • scanPaResourceRootPath

        public void scanPaResourceRootPath​(java.lang.ClassLoader classLoader,
                                           java.net.URL metaFileUrl,
                                           java.lang.String paResourceRootPath,
                                           java.util.Map<java.lang.String,​byte[]> resourceMap)
      • scanPaResourceRootPath

        public void scanPaResourceRootPath​(java.lang.ClassLoader classLoader,
                                           java.net.URL metaFileUrl,
                                           java.lang.String paResourceRootPath,
                                           java.lang.String[] additionalResourceSuffixes,
                                           java.util.Map<java.lang.String,​byte[]> resourceMap)
      • scanUrl

        protected void scanUrl​(java.net.URL url,
                               java.lang.String paResourceRootPath,
                               boolean isPaLocal,
                               java.lang.String[] additionalResourceSuffixes,
                               java.util.Map<java.lang.String,​byte[]> resourceMap)
      • scanPath

        protected void scanPath​(java.lang.String urlPath,
                                java.lang.String paResourceRootPath,
                                boolean isPaLocal,
                                java.lang.String[] additionalResourceSuffixes,
                                java.util.Map<java.lang.String,​byte[]> resourceMap)
      • handleArchive

        protected void handleArchive​(java.io.File file,
                                     java.lang.String paResourceRootPath,
                                     java.lang.String[] additionalResourceSuffixes,
                                     java.util.Map<java.lang.String,​byte[]> resourceMap)
      • handleDirectory

        protected void handleDirectory​(java.io.File directory,
                                       java.lang.String rootPath,
                                       java.lang.String localPath,
                                       java.lang.String paResourceRootPath,
                                       boolean isPaLocal,
                                       java.lang.String[] additionalResourceSuffixes,
                                       java.util.Map<java.lang.String,​byte[]> resourceMap)
      • addResource

        protected void addResource​(java.lang.Object source,
                                   java.util.Map<java.lang.String,​byte[]> resourceMap,
                                   java.lang.String resourceRootPath,
                                   java.lang.String resourceName)
      • loadClasspathResourceRoots

        protected java.util.Enumeration<java.net.URL> loadClasspathResourceRoots​(java.lang.ClassLoader classLoader,
                                                                                 java.lang.String strippedPaResourceRootPath)
      • isBelowPath

        protected boolean isBelowPath​(java.lang.String processFileName,
                                      java.lang.String paResourceRootPath)