public class JBossClassLoaderHandler extends Object implements ClassLoaderHandler
ClassLoaderHandler.DelegationOrder
Modifier and Type | Field and Description |
---|---|
static String[] |
HANDLED_CLASSLOADERS |
Constructor and Description |
---|
JBossClassLoaderHandler() |
Modifier and Type | Method and Description |
---|---|
ClassLoaderHandler.DelegationOrder |
getDelegationOrder(ClassLoader classLoaderInstance)
The delegation order configuration for a given ClassLoader instance (this is usually PARENT_FIRST for most
ClassLoaders, since you don't generally want to be able to override system classes with user classes, but
this can be overridden by some ClassLoaders, e.g.
|
void |
handle(ClassLoader classLoader,
ClasspathFinder classpathFinder,
ScanSpec scanSpec,
LogNode log)
Determine if a given ClassLoader can be handled (meaning that its classpath elements can be extracted from
it), and if it can, extract the classpath elements from the ClassLoader and register them with the
ClasspathFinder using classpathFinder.addClasspathElement(pathElement) or
classpathFinder.addClasspathElements(path).
|
public static final String[] HANDLED_CLASSLOADERS
public ClassLoaderHandler.DelegationOrder getDelegationOrder(ClassLoader classLoaderInstance)
ClassLoaderHandler
getDelegationOrder
in interface ClassLoaderHandler
public void handle(ClassLoader classLoader, ClasspathFinder classpathFinder, ScanSpec scanSpec, LogNode log) throws Exception
ClassLoaderHandler
handle
in interface ClassLoaderHandler
classLoader
- The ClassLoader class to attempt to handle. If you can't directly use instanceof (because you are
using introspection so that your ClassLoaderHandler implementation can be added to the upstream
FastClasspathScanner project), you should iterate through the ClassLoader's superclass lineage to
ensure subclasses of the target ClassLoader are correctly detected.classpathFinder
- The ClasspathFinder to register any discovered classpath elements with.scanSpec
- the scanning specification, in case it is needed, e.g. this could be used to reduce the number of
classpath elements returned in cases where it is very costly for a given classloader to return the
entire classpath. (The ScanSpec can be safely ignored, however, and the returned paths will be
filtered by FastClasspathScanner.)log
- A logger instance -- if this is non-null, write debug information using log.log("message").Exception
Copyright © 2017. All rights reserved.