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.DelegatingClassLoader
which cannot load its own classes by name.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher
Representation 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.String
DELEGATING_CLASS_LOADER_NAME
The name of the delegating class loader.private static ClassFileLocator.AgentBased.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher.Initializable
DISPATCHER
A dispatcher for extracting a class loader's loaded classes.private static int
ONLY
An 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 protected
ForDelegatingClassLoader(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 boolean
isDelegating(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:
true
if the class loader is a delegating class loader.
-
locate
public java.lang.Class<?> locate(java.lang.String name) throws java.lang.ClassNotFoundException
Loads a class by its name.- Specified by:
locate
in interfaceClassFileLocator.AgentBased.ClassLoadingDelegate
- Overrides:
locate
in 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.
-
-