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.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[]
acceptableSchemes
protected org.slf4j.Logger
log
-
Constructor Summary
Constructors Constructor Description BasePackageScanResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClassLoader(ClassLoader classLoader)
protected URL
customResourceLocator(URL url)
org.apache.camel.CamelContext
getCamelContext()
Set<ClassLoader>
getClassLoaders()
protected Enumeration<URL>
getResources(ClassLoader loader, String packageName)
Strategy to get the resources by the given classloader.protected boolean
isAcceptableScheme(String urlPath)
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, doInit, 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
-
-
-
-
Field Detail
-
log
protected final org.slf4j.Logger log
-
acceptableSchemes
protected String[] acceptableSchemes
-
-
Method Detail
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()
- Specified by:
getCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext)
- Specified by:
setCamelContext
in interfaceorg.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 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
-
-