Package net.bytebuddy.dynamic
Class ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader
- java.lang.Object
-
- net.bytebuddy.dynamic.ClassFileLocator.AgentBased.ClassLoadingDelegate.Default
-
- net.bytebuddy.dynamic.ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader
-
- All Implemented Interfaces:
ClassFileLocator.AgentBased.ClassLoadingDelegate
- Enclosing interface:
- ClassFileLocator.AgentBased.ClassLoadingDelegate
public static class ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader extends ClassFileLocator.AgentBased.ClassLoadingDelegate.Default
A class loading delegate that accounts for asun.reflect.DelegatingClassLoaderwhich cannot load its own classes by name.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.DispatcherRepresentation of a JavaField.-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.ClassFileLocator.AgentBased.ClassLoadingDelegate
ClassFileLocator.AgentBased.ClassLoadingDelegate.Default, ClassFileLocator.AgentBased.ClassLoadingDelegate.Explicit, ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringDELEGATING_CLASS_LOADER_NAMEThe name of the delegating class loader.private static ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher.InitializableDISPATCHERA dispatcher for extracting a class loader's loaded classes.private static intONLYAn index indicating the first element of a collection.-
Fields inherited from class net.bytebuddy.dynamic.ClassFileLocator.AgentBased.ClassLoadingDelegate.Default
classLoader
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedForDelegatingClassLoader(java.lang.ClassLoader classLoader)Creates a class loading delegate for a delegating class loader.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static booleanisDelegating(java.lang.ClassLoader classLoader)Checks if a class loader is a delegating class loader.java.lang.Class<?>locate(java.lang.String name)Loads a class by its name.-
Methods inherited from class net.bytebuddy.dynamic.ClassFileLocator.AgentBased.ClassLoadingDelegate.Default
getClassLoader, of
-
-
-
-
Field Detail
-
DELEGATING_CLASS_LOADER_NAME
private static final java.lang.String DELEGATING_CLASS_LOADER_NAME
The name of the delegating class loader.- See Also:
- Constant Field Values
-
ONLY
private static final int ONLY
An index indicating the first element of a collection.- See Also:
- Constant Field Values
-
DISPATCHER
private static final ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher.Initializable DISPATCHER
A dispatcher for extracting a class loader's loaded classes.
-
-
Method Detail
-
isDelegating
protected static boolean isDelegating(java.lang.ClassLoader classLoader)
Checks if a class loader is a delegating class loader.- Parameters:
classLoader- The class loader to inspect.- Returns:
trueif the class loader is a delegating class loader.
-
locate
public java.lang.Class<?> locate(java.lang.String name) throws java.lang.ClassNotFoundExceptionLoads a class by its name.- Specified by:
locatein interfaceClassFileLocator.AgentBased.ClassLoadingDelegate- Overrides:
locatein classClassFileLocator.AgentBased.ClassLoadingDelegate.Default- Parameters:
name- The name of the type.- Returns:
- The class with the given name.
- Throws:
java.lang.ClassNotFoundException- If a class cannot be found.
-
-