|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
org.springframework.instrument.classloading.AbstractOverridingClassLoader
public abstract class AbstractOverridingClassLoader
Abstract superclass for class loaders that do not always delegate to their parent loader, as normal class loaders do. This enables, for example, instrumentation to be forced, or a "throwaway" class loader behavior, where selected classes are loaded by a child loader but not loaded by the parent.
Constructor Summary | |
---|---|
protected |
AbstractOverridingClassLoader(ClassLoader parent)
Create a new AbstractOverridingClassLoader for the given class loader. |
Method Summary | |
---|---|
void |
excludeClass(String className)
Add a class name to exclude from overriding. |
void |
excludePackage(String packageName)
Add a package name to exclude from overriding. |
protected boolean |
isEligibleForOverriding(String className)
Determine whether the given class name is eligible for overriding by this class loader. |
protected Class<?> |
loadClass(String name,
boolean resolve)
|
protected abstract byte[] |
transformIfNecessary(String name,
byte[] bytes)
Transformation hook to be implemented by subclasses. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractOverridingClassLoader(ClassLoader parent)
parent
- the ClassLoader to build an overriding ClassLoader forMethod Detail |
---|
public void excludePackage(String packageName)
Any class whose fully-qualified name starts with the name registered here will be handled by the parent 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 parent ClassLoader in the usual fashion.
className
- the class name to excludeprotected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected boolean isEligibleForOverriding(String className)
The default implementation excludes all specified packages and classes.
className
- the class name to checkexcludePackage(java.lang.String)
,
excludeClass(java.lang.String)
protected abstract byte[] transformIfNecessary(String name, byte[] bytes)
name
- FQN of class being transformedbytes
- class bytes
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |