Class DefaultPackageScanResourceResolver

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.scan.BasePackageScanResolver
org.apache.camel.support.scan.DefaultPackageScanResourceResolver
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.NonManagedService, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.PackageScanResourceResolver, org.apache.camel.StatefulService, org.apache.camel.StaticService, org.apache.camel.SuspendableService

public class DefaultPackageScanResourceResolver extends BasePackageScanResolver implements org.apache.camel.spi.PackageScanResourceResolver, org.apache.camel.NonManagedService, org.apache.camel.CamelContextAware
Default implement of PackageScanResourceResolver
  • Constructor Details

    • DefaultPackageScanResourceResolver

      public DefaultPackageScanResourceResolver()
  • Method Details

    • findResources

      public Collection<org.apache.camel.spi.Resource> findResources(String location) throws Exception
      Specified by:
      findResources in interface org.apache.camel.spi.PackageScanResourceResolver
      Throws:
      Exception
    • findResources

      public Collection<org.apache.camel.spi.Resource> findResources(String location, Predicate<String> filter) throws Exception
      Specified by:
      findResources in interface org.apache.camel.spi.PackageScanResourceResolver
      Throws:
      Exception
    • doFindResources

      protected void doFindResources(String location, Set<org.apache.camel.spi.Resource> resources, Predicate<String> filter) throws Exception
      Throws:
      Exception
    • findInFileSystem

      protected void findInFileSystem(File dir, Set<org.apache.camel.spi.Resource> resources, String subPattern, Predicate<String> filter) throws Exception
      Throws:
      Exception
    • findInClasspath

      protected void findInClasspath(String packageName, Set<org.apache.camel.spi.Resource> resources, String subPattern, Predicate<String> filter)
    • doFind

      protected void doFind(String packageName, ClassLoader classLoader, Set<org.apache.camel.spi.Resource> resources, String subPattern, Predicate<String> filter)
    • loadImplementationsInJar

      protected void loadImplementationsInJar(URL url, String packageName, String subPattern, InputStream stream, String urlPath, Set<org.apache.camel.spi.Resource> resources, Predicate<String> filter)
      Finds matching classes within a jar files that contains a folder structure matching the package structure. If the File is not a JarFile or does not exist a warning will be logged, but no error will be raised.
      Parameters:
      packageName - the root package name
      subPattern - optional pattern to use for matching resource names
      stream - the input stream of the jar file to be examined for classes
      urlPath - the url of the jar file to be examined for classes
      resources - the list to add loaded resources
    • doLoadImplementationsInJar

      protected List<String> doLoadImplementationsInJar(String packageName, InputStream stream, String urlPath, Predicate<String> filter)