Package org.apache.camel.impl.engine
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
FieldsFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassLoader(ClassLoader classLoader) protected URLcustomResourceLocator(URL url) protected voiddoInit()org.apache.camel.CamelContextprotected Enumeration<URL> getResources(ClassLoader loader, String packageName) Strategy to get the resources by the given classloader.protected Enumeration<URL> getUrls(String packageName, ClassLoader loader) voidPerforms overridable initialization logic for the package scan resolverprotected booleanisAcceptableScheme(String urlPath) protected StringparseUrlPath(URL url) voidsetAcceptableSchemes(String schemes) To specify a set of accepted schemas to use for loading resources as URL connections (besides http and https schemas)voidsetCamelContext(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, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Field Details
-
acceptableSchemes
-
-
Constructor Details
-
BasePackageScanResolver
public BasePackageScanResolver()
-
-
Method Details
-
initialize
public void initialize()Performs overridable initialization logic for the package scan resolver -
doInit
- Overrides:
doInitin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContextin interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware
-
addClassLoader
-
setAcceptableSchemes
To specify a set of accepted schemas to use for loading resources as URL connections (besides http and https schemas) -
isAcceptableScheme
-
getClassLoaders
-
customResourceLocator
- Throws:
IOException
-
getResources
Strategy to get the resources by the given classloader. Notice that in WebSphere platforms there is aWebSpherePackageScanClassResolverto take care of WebSphere's oddity of resource loading.- Parameters:
loader- the classloaderpackageName- the packagename for the package to load- Returns:
- URL's for the given package
- Throws:
IOException- is thrown by the classloader
-
parseUrlPath
-
getUrls
-