Class ChildFirstClassLoader
java.lang.Object
java.lang.ClassLoader
de.iip_ecosphere.platform.support.plugins.ChildFirstClassLoader
- All Implemented Interfaces:
IdentifyingClassloader
- Direct Known Subclasses:
ChildFirstURLClassLoader
A delegating child-first classloader.
- Author:
- Stackoverflow, Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a child-first classloader using the context class loader of the current thread as parent.ChildFirstClassLoader(Function<FindClassClassLoader, ChildClassLoader> creator, ClassLoader parent) Creates a child-first classloader. -
Method Summary
Modifier and TypeMethodDescriptionbooleanamI(ClassLoader loader) Returns whether this class loader or one of its child loaders corresponds to the givenloader.voidgetResource(String name) getResourceAsStream(String name) getResources(String name) protected Class<?> voidsetClassAssertionStatus(String className, boolean enabled) voidsetDefaultAssertionStatus(boolean enabled) voidsetPackageAssertionStatus(String packageName, boolean enabled) toString()Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setSigners
-
Field Details
-
childClassLoader
-
-
Constructor Details
-
ChildFirstClassLoader
Creates a child-first classloader using the context class loader of the current thread as parent.- Parameters:
creator- a function creating the child classloader
-
ChildFirstClassLoader
public ChildFirstClassLoader(Function<FindClassClassLoader, ChildClassLoader> creator, ClassLoader parent) Creates a child-first classloader.- Parameters:
creator- a function creating the child classloaderparent- the parent class loader
-
-
Method Details
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
getResource
- Overrides:
getResourcein classClassLoader
-
getResources
- Overrides:
getResourcesin classClassLoader- Throws:
IOException
-
getResourceAsStream
- Overrides:
getResourceAsStreamin classClassLoader
-
setClassAssertionStatus
- Overrides:
setClassAssertionStatusin classClassLoader
-
clearAssertionStatus
public void clearAssertionStatus()- Overrides:
clearAssertionStatusin classClassLoader
-
setDefaultAssertionStatus
public void setDefaultAssertionStatus(boolean enabled) - Overrides:
setDefaultAssertionStatusin classClassLoader
-
setPackageAssertionStatus
- Overrides:
setPackageAssertionStatusin classClassLoader
-
amI
Description copied from interface:IdentifyingClassloaderReturns whether this class loader or one of its child loaders corresponds to the givenloader.- Specified by:
amIin interfaceIdentifyingClassloader- Parameters:
loader- the loader to check for- Returns:
trueif this class loader or one of its child loaders corresponds,falseelse
-
toString
-