Package net.bytebuddy.dynamic.loading
Class ClassInjector.UsingReflection.Dispatcher.Initializable.Unavailable
java.lang.Object
net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher.Initializable.Unavailable
- All Implemented Interfaces:
ClassInjector.UsingReflection.Dispatcher,ClassInjector.UsingReflection.Dispatcher.Initializable
- Enclosing interface:
ClassInjector.UsingReflection.Dispatcher.Initializable
@Enhance
public static class ClassInjector.UsingReflection.Dispatcher.Initializable.Unavailable
extends Object
implements ClassInjector.UsingReflection.Dispatcher, ClassInjector.UsingReflection.Dispatcher.Initializable
Represents an unsuccessfully loaded method lookup.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher
ClassInjector.UsingReflection.Dispatcher.CreationAction, ClassInjector.UsingReflection.Dispatcher.Direct, ClassInjector.UsingReflection.Dispatcher.Initializable, ClassInjector.UsingReflection.Dispatcher.Unavailable, ClassInjector.UsingReflection.Dispatcher.UsingUnsafeInjection, ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverrideNested classes/interfaces inherited from interface net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher.Initializable
ClassInjector.UsingReflection.Dispatcher.Initializable.Unavailable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe reason why this dispatcher is not available.Fields inherited from interface net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher
UNDEFINED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUnavailable(String message) Creates a new faulty reflection store. -
Method Summary
Modifier and TypeMethodDescriptionClass<?> defineClass(ClassLoader classLoader, String name, byte[] binaryRepresentation, ProtectionDomain protectionDomain) Defines a class for the given class loader.definePackage(ClassLoader classLoader, String name, String specificationTitle, String specificationVersion, String specificationVendor, String implementationTitle, String implementationVersion, String implementationVendor, URL sealBase) Defines a package for the given class loader.Class<?> findClass(ClassLoader classLoader, String name) Looks up a class from the given class loader.getClassLoadingLock(ClassLoader classLoader, String name) Returns the lock for loading the specified class.getDefinedPackage(ClassLoader classLoader, String name) Looks up a package from a class loader.getPackage(ClassLoader classLoader, String name) Looks up a package from a class loader or its ancestor.Initializes this dispatcher.booleanIndicates if this dispatcher is available.
-
Field Details
-
message
The reason why this dispatcher is not available.
-
-
Constructor Details
-
Unavailable
Creates a new faulty reflection store.- Parameters:
message- The reason why this dispatcher is not available.
-
-
Method Details
-
isAvailable
public boolean isAvailable()Indicates if this dispatcher is available.- Specified by:
isAvailablein interfaceClassInjector.UsingReflection.Dispatcher.Initializable- Returns:
trueif this dispatcher is available.
-
initialize
Initializes this dispatcher.- Specified by:
initializein interfaceClassInjector.UsingReflection.Dispatcher.Initializable- Returns:
- The initialized dispatcher.
-
getClassLoadingLock
Returns the lock for loading the specified class.- Specified by:
getClassLoadingLockin interfaceClassInjector.UsingReflection.Dispatcher- Parameters:
classLoader- the class loader to inject the class into.name- The name of the class.- Returns:
- The lock for loading this class.
-
findClass
Looks up a class from the given class loader.- Specified by:
findClassin interfaceClassInjector.UsingReflection.Dispatcher- Parameters:
classLoader- The class loader for which a class should be located.name- The binary name of the class that should be located.- Returns:
- The class for the binary name or
nullif no such class is defined for the provided class loader.
-
defineClass
public Class<?> defineClass(ClassLoader classLoader, String name, byte[] binaryRepresentation, @MaybeNull ProtectionDomain protectionDomain) Defines a class for the given class loader.- Specified by:
defineClassin interfaceClassInjector.UsingReflection.Dispatcher- Parameters:
classLoader- The class loader for which a new class should be defined.name- The binary name of the class that should be defined.binaryRepresentation- The binary representation of the class.protectionDomain- The protection domain for the defined class.- Returns:
- The defined, loaded class.
-
getDefinedPackage
Looks up a package from a class loader. If the operation is not supported, falls back toClassInjector.UsingReflection.Dispatcher.getPackage(ClassLoader, String)- Specified by:
getDefinedPackagein interfaceClassInjector.UsingReflection.Dispatcher- Parameters:
classLoader- The class loader to query.name- The binary name of the package.- Returns:
- The package for the given name as defined by the provided class loader or
nullif no such package exists.
-
getPackage
Looks up a package from a class loader or its ancestor.- Specified by:
getPackagein interfaceClassInjector.UsingReflection.Dispatcher- Parameters:
classLoader- The class loader to query.name- The binary name of the package.- Returns:
- The package for the given name as defined by the provided class loader or its ancestor, or
nullif no such package exists.
-
definePackage
public Package definePackage(ClassLoader classLoader, String name, @MaybeNull String specificationTitle, @MaybeNull String specificationVersion, @MaybeNull String specificationVendor, @MaybeNull String implementationTitle, @MaybeNull String implementationVersion, @MaybeNull String implementationVendor, @MaybeNull URL sealBase) Defines a package for the given class loader.- Specified by:
definePackagein interfaceClassInjector.UsingReflection.Dispatcher- Parameters:
classLoader- The class loader for which a package is to be defined.name- The binary name of the package.specificationTitle- The specification title of the package ornullif no specification title exists.specificationVersion- The specification version of the package ornullif no specification version exists.specificationVendor- The specification vendor of the package ornullif no specification vendor exists.implementationTitle- The implementation title of the package ornullif no implementation title exists.implementationVersion- The implementation version of the package ornullif no implementation version exists.implementationVendor- The implementation vendor of the package ornullif no implementation vendor exists.sealBase- The seal base URL ornullif the package should not be sealed.- Returns:
- The defined package.
-