Class BasePackageScanResolver

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.impl.engine.BasePackageScanResolver
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasCamelContext, org.apache.camel.StatefulService, org.apache.camel.SuspendableService
Direct Known Subclasses:
DefaultPackageScanClassResolver, DefaultPackageScanResourceResolver

public abstract class BasePackageScanResolver extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.CamelContextAware
Base class for package scan resolvers.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String[]
     

    Fields inherited from class org.apache.camel.support.service.BaseService

    BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected URL
     
    protected void
     
    org.apache.camel.CamelContext
     
     
    protected Enumeration<URL>
    getResources(ClassLoader loader, String packageName)
    Strategy to get the resources by the given classloader.
    protected Enumeration<URL>
    getUrls(String packageName, ClassLoader loader)
     
    void
    Performs overridable initialization logic for the package scan resolver
    protected boolean
     
    protected String
     
    void
    To specify a set of accepted schemas to use for loading resources as URL connections (besides http and https schemas)
    void
    setCamelContext(org.apache.camel.CamelContext camelContext)
     

    Methods inherited from class org.apache.camel.support.service.BaseService

    build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods inherited from interface org.apache.camel.SuspendableService

    isSuspended, resume, suspend
  • Field Details

    • acceptableSchemes

      protected String[] acceptableSchemes
  • Constructor Details

    • BasePackageScanResolver

      public BasePackageScanResolver()
  • Method Details

    • initialize

      public void initialize()
      Performs overridable initialization logic for the package scan resolver
    • doInit

      protected void doInit() throws Exception
      Overrides:
      doInit in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • getCamelContext

      public org.apache.camel.CamelContext getCamelContext()
      Specified by:
      getCamelContext in interface org.apache.camel.spi.HasCamelContext
    • setCamelContext

      public void setCamelContext(org.apache.camel.CamelContext camelContext)
      Specified by:
      setCamelContext in interface org.apache.camel.CamelContextAware
    • addClassLoader

      public void addClassLoader(ClassLoader classLoader)
    • setAcceptableSchemes

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

      protected boolean isAcceptableScheme(String urlPath)
    • getClassLoaders

      public Set<ClassLoader> getClassLoaders()
    • customResourceLocator

      protected URL customResourceLocator(URL url) throws IOException
      Throws:
      IOException
    • getResources

      protected Enumeration<URL> getResources(ClassLoader loader, String packageName) throws IOException
      Strategy to get the resources by the given classloader.

      Notice that in WebSphere platforms there is a WebSpherePackageScanClassResolver to take care of WebSphere's oddity of resource loading.

      Parameters:
      loader - the classloader
      packageName - the packagename for the package to load
      Returns:
      URL's for the given package
      Throws:
      IOException - is thrown by the classloader
    • parseUrlPath

      protected String parseUrlPath(URL url)
    • getUrls

      protected Enumeration<URL> getUrls(String packageName, ClassLoader loader)