Class ShadowingClassLoader
java.lang.Object
java.lang.ClassLoader
org.springframework.core.DecoratingClassLoader
org.springframework.instrument.classloading.ShadowingClassLoader
- Direct Known Subclasses:
- ResourceOverridingShadowingClassLoader
ClassLoader decorator that shadows an enclosing ClassLoader,
 applying registered transformers to all affected classes.
- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller, Costin Leau
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionShadowingClassLoader(ClassLoader enclosingClassLoader) Create a new ShadowingClassLoader, decorating the given ClassLoader, applyingDEFAULT_EXCLUDED_PACKAGES.ShadowingClassLoader(ClassLoader enclosingClassLoader, boolean defaultExcludes) Create a new ShadowingClassLoader, decorating the given ClassLoader.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddTransformer(ClassFileTransformer transformer) Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.voidCopy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.getResource(String name) getResourceAsStream(String name) getResources(String name) protected booleanisEligibleForShadowing(String className) Determine whether the specified class is eligible for shadowing by this class loader.Class<?>Methods inherited from class org.springframework.core.DecoratingClassLoaderexcludeClass, excludePackage, isExcludedMethods inherited from class java.lang.ClassLoaderclearAssertionStatus, 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, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
- 
Field Details- 
DEFAULT_EXCLUDED_PACKAGESPackages that are excluded by default.
 
- 
- 
Constructor Details- 
ShadowingClassLoaderCreate a new ShadowingClassLoader, decorating the given ClassLoader, applyingDEFAULT_EXCLUDED_PACKAGES.- Parameters:
- enclosingClassLoader- the ClassLoader to decorate
- See Also:
 
- 
ShadowingClassLoaderCreate a new ShadowingClassLoader, decorating the given ClassLoader.- Parameters:
- enclosingClassLoader- the ClassLoader to decorate
- defaultExcludes- whether to apply- DEFAULT_EXCLUDED_PACKAGES
- Since:
- 4.3.8
 
 
- 
- 
Method Details- 
addTransformerAdd the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.- Parameters:
- transformer- the ClassFileTransformer
 
- 
copyTransformersCopy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.- Parameters:
- other- the ClassLoader to copy from
 
- 
loadClass- Overrides:
- loadClassin class- ClassLoader
- Throws:
- ClassNotFoundException
 
- 
isEligibleForShadowingDetermine whether the specified class is eligible for shadowing by this class loader.- Parameters:
- className- the class name to check
- Returns:
- whether the specified class is eligible
- See Also:
 
- 
getResource- Overrides:
- getResourcein class- ClassLoader
 
- 
getResourceAsStream- Overrides:
- getResourceAsStreamin class- ClassLoader
 
- 
getResources- Overrides:
- getResourcesin class- ClassLoader
- Throws:
- IOException
 
 
-