Class ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.ForDelegatingClassLoader
java.lang.Object
net.bytebuddy.dynamic.ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default
net.bytebuddy.dynamic.ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.ForDelegatingClassLoader
- All Implemented Interfaces:
ClassFileLocator.ForInstrumentation.ClassLoadingDelegate
- Enclosing interface:
ClassFileLocator.ForInstrumentation.ClassLoadingDelegate
public static class ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.ForDelegatingClassLoader
extends ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default
A class loading delegate that accounts for a
sun.reflect.DelegatingClassLoader which
cannot load its own classes by name.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default
ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default.BootLoaderProxyCreationActionNested classes/interfaces inherited from interface ClassFileLocator.ForInstrumentation.ClassLoadingDelegate
ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default, ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Explicit, ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.ForDelegatingClassLoader -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringThe name of the delegating class loader.private static final ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher.InitializableA dispatcher for extracting a class loader's loaded classes.private static final intAn index indicating the first element of a collection.Fields inherited from class ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default
classLoader -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForDelegatingClassLoader(ClassLoader classLoader) Creates a class loading delegate for a delegating class loader. -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> TdoPrivileged(PrivilegedAction<T> action) A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.protected static booleanisDelegating(ClassLoader classLoader) Checks if a class loader is a delegating class loader.Class<?> Loads a class by its name.Methods inherited from class ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default
getClassLoader, of
-
Field Details
-
DELEGATING_CLASS_LOADER_NAME
The name of the delegating class loader.- See Also:
-
ONLY
private static final int ONLYAn index indicating the first element of a collection.- See Also:
-
DISPATCHER
private static final ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.ForDelegatingClassLoader.Dispatcher.Initializable DISPATCHERA dispatcher for extracting a class loader's loaded classes.
-
-
Constructor Details
-
ForDelegatingClassLoader
Creates a class loading delegate for a delegating class loader.- Parameters:
classLoader- The delegating class loader.
-
-
Method Details
-
doPrivileged
A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.- Type Parameters:
T- The type of the action's resolved value.- Parameters:
action- The action to execute from a privileged context.- Returns:
- The action's resolved value.
-
isDelegating
Checks if a class loader is a delegating class loader.- Parameters:
classLoader- The class loader to inspect ornullto check the boot loader.- Returns:
trueif the class loader is a delegating class loader.
-
locate
Loads a class by its name.- Specified by:
locatein interfaceClassFileLocator.ForInstrumentation.ClassLoadingDelegate- Overrides:
locatein classClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default- Parameters:
name- The name of the type.- Returns:
- The class with the given name.
- Throws:
ClassNotFoundException- If a class cannot be found.
-