Interface PackageScanResourceResolver

All Superinterfaces:
AutoCloseable, Service, StaticService

public interface PackageScanResourceResolver extends StaticService
A resolver that can find resources based on package scanning. OSGi is not supported as this is intended for standalone Camel runtimes such as Camel Main, or Camel Quarkus.
See Also:
  • Method Details

    • getClassLoaders

      Set<ClassLoader> getClassLoaders()
      Gets the ClassLoader instances that should be used when scanning for resources.

      This implementation will return a new unmodifiable set containing the classloaders. Use the addClassLoader(ClassLoader) method if you want to add new classloaders to the class loaders list.

      Returns:
      the class loaders to use
    • addClassLoader

      void addClassLoader(ClassLoader classLoader)
      Adds the class loader to the existing loaders
      Parameters:
      classLoader - the loader to add
    • setAcceptableSchemes

      void setAcceptableSchemes(String schemes)
      To specify a set of accepted schemas to use for loading resources as URL connections (besides http and https schemas)
    • findResources

      Collection<Resource> findResources(String location) throws Exception
      Finds the resources from the given location. The location can be prefixed with either file: or classpath: to look in either file system or classpath. By default classpath is assumed if no prefix is specified. Wildcards is supported using a ANT pattern style paths, such as classpath:**/*camel*.xml Notice when using wildcards, then there is additional overhead as the classpath is scanned, where as if you specific the exact name for each XML file is faster as no classpath scanning is needed.
      Parameters:
      location - the location (support ANT style patterns, eg routes/camel-*.xml)
      Returns:
      the found resources, or an empty collection if no resources found
      Throws:
      Exception - can be thrown during scanning for resources.