|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader org.springframework.instrument.classloading.ShadowingClassLoader
public class ShadowingClassLoader
ClassLoader decorator that shadows an enclosing ClassLoader, applying registered transformers to all affected classes.
addTransformer(java.lang.instrument.ClassFileTransformer)
,
OverridingClassLoader
Field Summary | |
---|---|
static String[] |
DEFAULT_EXCLUDED_PACKAGES
Packages that are excluded by default |
Constructor Summary | |
---|---|
ShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ShadowingClassLoader, decorating the given ClassLoader. |
Method Summary | |
---|---|
void |
addTransformer(ClassFileTransformer transformer)
Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply. |
void |
copyTransformers(ShadowingClassLoader other)
Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply. |
void |
excludeClass(String className)
Add a class name to exclude from shadowing. |
void |
excludePackage(String packageName)
Add a package name to exclude from shadowing. |
URL |
getResource(String name)
|
InputStream |
getResourceAsStream(String name)
|
Enumeration<URL> |
getResources(String name)
|
protected boolean |
isClassNameExcludedFromShadowing(String className)
Deprecated. in favor of isEligibleForShadowing(java.lang.String) |
protected boolean |
isEligibleForShadowing(String className)
Determine whether the specified class is eligible for shadowing by this class loader. |
Class<?> |
loadClass(String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String[] DEFAULT_EXCLUDED_PACKAGES
Constructor Detail |
---|
public ShadowingClassLoader(ClassLoader enclosingClassLoader)
enclosingClassLoader
- the ClassLoader to decorateMethod Detail |
---|
public void excludePackage(String packageName)
Any class whose fully-qualified name starts with the name registered here will be handled by the enclosing ClassLoader in the usual fashion.
packageName
- the package name to excludepublic void excludeClass(String className)
Any class name registered here will be handled by the enclosing ClassLoader in the usual fashion.
className
- the class name to excludepublic void addTransformer(ClassFileTransformer transformer)
transformer
- the ClassFileTransformerpublic void copyTransformers(ShadowingClassLoader other)
other
- the ClassLoader to copy frompublic Class<?> loadClass(String name) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected boolean isEligibleForShadowing(String className)
The default implementation checks against excluded packages and classes.
className
- the class name to check
excludePackage(java.lang.String)
,
excludeClass(java.lang.String)
protected boolean isClassNameExcludedFromShadowing(String className)
isEligibleForShadowing(java.lang.String)
className
- the class name to test
public URL getResource(String name)
getResource
in class ClassLoader
public InputStream getResourceAsStream(String name)
getResourceAsStream
in class ClassLoader
public Enumeration<URL> getResources(String name) throws IOException
getResources
in class ClassLoader
IOException
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |