类 ShadowingClassLoader
- java.lang.Object
- java.lang.ClassLoader
- org.springframework.core.DecoratingClassLoader
- org.springframework.instrument.classloading.ShadowingClassLoader
public class ShadowingClassLoader extends DecoratingClassLoader
ClassLoader decorator that shadows an enclosing ClassLoader, applying registered transformers to all affected classes.- 从以下版本开始:
- 2.0
- 作者:
- Rob Harrop, Juergen Hoeller, Costin Leau
- 另请参阅:
addTransformer(java.lang.instrument.ClassFileTransformer)
,OverridingClassLoader
字段概要
字段 修饰符和类型 字段 说明 static String[]
DEFAULT_EXCLUDED_PACKAGES
Packages that are excluded by default从类继承的字段 org.springframework.core.DecoratingClassLoader
parallelCapableClassLoaderAvailable
构造器概要
构造器 构造器 说明 ShadowingClassLoader(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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.URL
getResource(String name)
InputStream
getResourceAsStream(String name)
Enumeration<URL>
getResources(String name)
protected boolean
isEligibleForShadowing(String className)
Determine whether the specified class is eligible for shadowing by this class loader.Class<?>
loadClass(String name)
从类继承的方法 org.springframework.core.DecoratingClassLoader
excludeClass, excludePackage, isExcluded
从类继承的方法 java.lang.ClassLoader
clearAssertionStatus, 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
字段详细资料
DEFAULT_EXCLUDED_PACKAGES
public static final String[] DEFAULT_EXCLUDED_PACKAGES
Packages that are excluded by default
构造器详细资料
ShadowingClassLoader
public ShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ShadowingClassLoader, decorating the given ClassLoader, applyingDEFAULT_EXCLUDED_PACKAGES
.- 参数:
enclosingClassLoader
- the ClassLoader to decorate- 另请参阅:
ShadowingClassLoader(ClassLoader, boolean)
ShadowingClassLoader
public ShadowingClassLoader(ClassLoader enclosingClassLoader, boolean defaultExcludes)
Create a new ShadowingClassLoader, decorating the given ClassLoader.- 参数:
enclosingClassLoader
- the ClassLoader to decoratedefaultExcludes
- whether to applyDEFAULT_EXCLUDED_PACKAGES
- 从以下版本开始:
- 4.3.8
方法详细资料
addTransformer
public void addTransformer(ClassFileTransformer transformer)
Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.- 参数:
transformer
- the ClassFileTransformer
copyTransformers
public void copyTransformers(ShadowingClassLoader other)
Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.- 参数:
other
- the ClassLoader to copy from
loadClass
public Class<?> loadClass(String name) throws ClassNotFoundException
- 覆盖:
loadClass
在类中ClassLoader
- 抛出:
ClassNotFoundException
isEligibleForShadowing
protected boolean isEligibleForShadowing(String className)
Determine whether the specified class is eligible for shadowing by this class loader.- 参数:
className
- the class name to check- 返回:
- whether the specified class is eligible
- 另请参阅:
DecoratingClassLoader.isExcluded(java.lang.String)
getResource
public URL getResource(String name)
- 覆盖:
getResource
在类中ClassLoader
getResourceAsStream
public InputStream getResourceAsStream(String name)
- 覆盖:
getResourceAsStream
在类中ClassLoader
getResources
public Enumeration<URL> getResources(String name) throws IOException
- 覆盖:
getResources
在类中ClassLoader
- 抛出:
IOException