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 TypeMethodDescriptionvoid
addClassLoader
(ClassLoader classLoader) protected URL
customResourceLocator
(URL url) protected void
doInit()
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 resolverprotected boolean
isAcceptableScheme
(String urlPath) protected String
parseUrlPath
(URL url) void
setAcceptableSchemes
(String schemes) 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
-
-
Constructor Details
-
BasePackageScanResolver
public BasePackageScanResolver()
-
-
Method Details
-
initialize
public void initialize()Performs overridable initialization logic for the package scan resolver -
doInit
- Overrides:
doInit
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContext
in interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContext
in 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 aWebSpherePackageScanClassResolver
to 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
-