Top Description Constructors Methods
nonapi.io.github.classgraph.classloaderhandler

pack-priv Class FelixClassLoaderHandler

extends Object
implements ClassLoaderHandler
Class Inheritance
All Implemented Interfaces
nonapi.io.github.classgraph.classloaderhandler.ClassLoaderHandler
Imports
java.io.File, java.util.HashSet, .List, .Set, nonapi.io.github.classgraph.classpath.ClassLoaderOrder, .ClasspathOrder, nonapi.io.github.classgraph.reflection.ReflectionUtils, nonapi.io.github.classgraph.scanspec.ScanSpec, nonapi.io.github.classgraph.utils.LogNode

Custom Class Loader Handler for OSGi Felix ClassLoader.

The handler adds the bundle jar and all assocaited Bundle-Claspath jars into the classpath to be scanned.

Author
elrufaie

Constructor Summary

AccessConstructor and Description
private
FelixClassLoaderHandler()

Class cannot be constructed.

Method Summary

Modifier and TypeMethod and Description
private static void
addBundle(final Object
the bundle wiring
bundleWiring
,
final ClassLoader
the classloader
classLoader
,
final ClasspathOrder
the classpath order out
classpathOrderOut
,
final Set<Object>
the bundles
bundles
,
final ScanSpec
the scan spec
scanSpec
,
final LogNode
the log
log
)

Adds the bundle.

public static boolean

Returns:

true if this ClassLoaderHandler can handle the ClassLoader.
canHandle
(final Class<?>
the ClassLoader class or one of its superclasses.
classLoaderClass
,
final LogNode
the log
log
)

Check whether this ClassLoaderHandler can handle a given ClassLoader.

public static void
findClassLoaderOrder(final ClassLoader
the ClassLoader to find the order for.
classLoader
,
final ClassLoaderOrder
a ClassLoaderOrder object to update.
classLoaderOrder
,
final LogNode
the log
log
)

Find the ClassLoader delegation order for a ClassLoader.

public static void
findClasspathOrder(final ClassLoader
the ClassLoader to find the classpath entries order for.
classLoader
,
final ClasspathOrder
a ClasspathOrder object to update.
classpathOrder
,
final ScanSpec scanSpec, final LogNode
the log.
log
)

Find the classpath entries for the associated ClassLoader.

private static File

Returns:

the content location
getContentLocation
(final Object
the content object
content
,
final ReflectionUtils reflectionUtils)

Get the content location.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FelixClassLoaderHandlerback to summary
private FelixClassLoaderHandler()

Class cannot be constructed.

Method Detail

addBundleback to summary
private static void addBundle(final Object bundleWiring, final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final Set<Object> bundles, final ScanSpec scanSpec, final LogNode log)

Adds the bundle.

Parameters
bundleWiring:Object

the bundle wiring

classLoader:ClassLoader

the classloader

classpathOrderOut:ClasspathOrder

the classpath order out

bundles:Set<Object>

the bundles

scanSpec:ScanSpec

the scan spec

log:LogNode

the log

canHandleback to summary
public static boolean canHandle(final Class<?> classLoaderClass, final LogNode log)

Check whether this ClassLoaderHandler can handle a given ClassLoader.

Parameters
classLoaderClass:Class<?>

the ClassLoader class or one of its superclasses.

log:LogNode

the log

Returns:boolean

true if this ClassLoaderHandler can handle the ClassLoader.

findClassLoaderOrderback to summary
public static void findClassLoaderOrder(final ClassLoader classLoader, final ClassLoaderOrder classLoaderOrder, final LogNode log)

Find the ClassLoader delegation order for a ClassLoader.

Parameters
classLoader:ClassLoader

the ClassLoader to find the order for.

classLoaderOrder:ClassLoaderOrder

a ClassLoaderOrder object to update.

log:LogNode

the log

findClasspathOrderback to summary
public static void findClasspathOrder(final ClassLoader classLoader, final ClasspathOrder classpathOrder, final ScanSpec scanSpec, final LogNode log)

Find the classpath entries for the associated ClassLoader.

Parameters
classLoader:ClassLoader

the ClassLoader to find the classpath entries order for.

classpathOrder:ClasspathOrder

a ClasspathOrder object to update.

scanSpec:ScanSpec

the ScanSpec.

log:LogNode

the log.

getContentLocationback to summary
private static File getContentLocation(final Object content, final ReflectionUtils reflectionUtils)

Get the content location.

Parameters
content:Object

the content object

Returns:File

the content location