Package org.apache.camel.impl.engine
Class DefaultPackageScanResourceResolver
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.impl.engine.BasePackageScanResolver
org.apache.camel.impl.engine.DefaultPackageScanResourceResolver
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.NonManagedService,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.PackageScanResourceResolver,org.apache.camel.StatefulService,org.apache.camel.StaticService,org.apache.camel.SuspendableService
public class DefaultPackageScanResourceResolver
extends BasePackageScanResolver
implements org.apache.camel.spi.PackageScanResourceResolver, org.apache.camel.NonManagedService, org.apache.camel.CamelContextAware
Default implement of
PackageScanResourceResolver-
Field Summary
Fields inherited from class org.apache.camel.impl.engine.BasePackageScanResolver
acceptableSchemes, logFields 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 TypeMethodDescriptionprotected voiddoFind(String packageName, ClassLoader classLoader, Set<org.apache.camel.spi.Resource> resources, String subPattern) protected voiddoFindResources(String location, Set<org.apache.camel.spi.Resource> resources) doLoadImplementationsInJar(String packageName, InputStream stream, String urlPath) protected voidfindInClasspath(String packageName, Set<org.apache.camel.spi.Resource> resources, String subPattern) protected voidfindInFileSystem(File dir, Set<org.apache.camel.spi.Resource> resources, String subPattern) Collection<org.apache.camel.spi.Resource>findResources(String location) protected voidloadImplementationsInJar(String packageName, String subPattern, InputStream stream, String urlPath, Set<org.apache.camel.spi.Resource> resources) Finds matching classes within a jar files that contains a folder structure matching the package structure.Methods inherited from class org.apache.camel.impl.engine.BasePackageScanResolver
addClassLoader, customResourceLocator, doInit, getCamelContext, getClassLoaders, getResources, initialize, isAcceptableScheme, setAcceptableSchemes, setCamelContextMethods 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, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContextMethods inherited from interface org.apache.camel.spi.PackageScanResourceResolver
addClassLoader, getClassLoaders, setAcceptableSchemesMethods 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
-
Constructor Details
-
DefaultPackageScanResourceResolver
public DefaultPackageScanResourceResolver()
-
-
Method Details
-
findResources
- Specified by:
findResourcesin interfaceorg.apache.camel.spi.PackageScanResourceResolver- Throws:
Exception
-
doFindResources
protected void doFindResources(String location, Set<org.apache.camel.spi.Resource> resources) throws Exception - Throws:
Exception
-
findInFileSystem
protected void findInFileSystem(File dir, Set<org.apache.camel.spi.Resource> resources, String subPattern) throws Exception - Throws:
Exception
-
findInClasspath
-
doFind
protected void doFind(String packageName, ClassLoader classLoader, Set<org.apache.camel.spi.Resource> resources, String subPattern) -
loadImplementationsInJar
protected void loadImplementationsInJar(String packageName, String subPattern, InputStream stream, String urlPath, Set<org.apache.camel.spi.Resource> resources) Finds matching classes within a jar files that contains a folder structure matching the package structure. If the File is not a JarFile or does not exist a warning will be logged, but no error will be raised.- Parameters:
packageName- the root package namesubPattern- optional pattern to use for matching resource namesstream- the inputstream of the jar file to be examined for classesurlPath- the url of the jar file to be examined for classesresources- the list to add loaded resources
-
doLoadImplementationsInJar
protected List<String> doLoadImplementationsInJar(String packageName, InputStream stream, String urlPath)
-