public abstract static class ClassInjector.UsingReflection.Dispatcher.Resolved extends Object implements ClassInjector.UsingReflection.Dispatcher, ClassInjector.UsingReflection.Dispatcher.Initializable
Modifier and Type | Class and Description |
---|---|
protected static class |
ClassInjector.UsingReflection.Dispatcher.Resolved.ForJava7CapableVm
A resolved class dispatcher for a class injector on a VM running at least Java 7.
|
protected static class |
ClassInjector.UsingReflection.Dispatcher.Resolved.ForLegacyVm
A resolved class dispatcher for a class injector prior to Java 7.
|
protected static class |
ClassInjector.UsingReflection.Dispatcher.Resolved.UnsafeDispatcher
A dispatcher that uses
sun.misc.Unsafe for class loading but which is incapable of defining packages. |
ClassInjector.UsingReflection.Dispatcher.Faulty, ClassInjector.UsingReflection.Dispatcher.Initializable, ClassInjector.UsingReflection.Dispatcher.Resolved
Modifier and Type | Field and Description |
---|---|
protected Method |
defineClass
|
protected Method |
defineClassUnsafe
An instance of
sun.misc.Unsafe#defineClass(String, byte[], int, int, ClassLoader, ProtectionDomain)
or null if it is not available. |
protected Method |
definePackage
|
protected Method |
findLoadedClass
An instance of
ClassLoader.findLoadedClass(String) . |
protected Method |
getPackage
An instance of
ClassLoader.getPackage(String) or ClassLoader#getDefinedPackage(String) . |
protected Field |
theUnsafe
An instance of
sun.misc.Unsafe#theUnsafe or null if it is not available. |
UNDEFINED
Modifier | Constructor and Description |
---|---|
protected |
Resolved(Method findLoadedClass,
Method defineClass,
Method getPackage,
Method definePackage,
Field theUnsafe,
Method defineClassUnsafe)
Creates a new resolved reflection store.
|
Modifier and Type | Method and Description |
---|---|
Class<?> |
defineClass(ClassLoader classLoader,
String name,
byte[] binaryRepresentation,
ProtectionDomain protectionDomain)
Defines a class for the given class loader.
|
Package |
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.
|
boolean |
equals(Object other) |
Class<?> |
findClass(ClassLoader classLoader,
String name)
Looks up a class from the given class loader.
|
Package |
getPackage(ClassLoader classLoader,
String name)
Looks up a package from a class loader.
|
int |
hashCode() |
ClassInjector.UsingReflection.Dispatcher |
initialize()
Initializes this dispatcher.
|
protected static ClassInjector.UsingReflection.Dispatcher.Initializable |
make()
Obtains the reflective instances used by this injector or a no-op instance that throws the exception
that occurred when attempting to obtain the reflective member instances.
|
protected abstract void |
onInitialization()
Invoked upon initializing methods.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getClassLoadingLock
protected final Method findLoadedClass
ClassLoader.findLoadedClass(String)
.protected final Method defineClass
protected final Method getPackage
ClassLoader.getPackage(String)
or ClassLoader#getDefinedPackage(String)
.protected final Method definePackage
protected final Field theUnsafe
sun.misc.Unsafe#theUnsafe
or null
if it is not available.protected final Method defineClassUnsafe
sun.misc.Unsafe#defineClass(String, byte[], int, int, ClassLoader, ProtectionDomain)
or null
if it is not available.protected Resolved(Method findLoadedClass, Method defineClass, Method getPackage, Method definePackage, Field theUnsafe, Method defineClassUnsafe)
findLoadedClass
- An instance of ClassLoader.findLoadedClass(String)
.defineClass
- An instance of ClassLoader.defineClass(String, byte[], int, int, ProtectionDomain)
.getPackage
- An instance of ClassLoader.getPackage(String)
or ClassLoader#getDefinedPackage(String)
.definePackage
- An instance of ClassLoader.definePackage(String, String, String, String, String, String, String, URL)
.defineClassUnsafe
- An instance of sun.misc.Unsafe#theUnsafe
or null
if it is not available.theUnsafe
- An instance of sun.misc.Unsafe#defineClass(String, byte[], int, int, ClassLoader, ProtectionDomain)
or null
if it is not available.protected static ClassInjector.UsingReflection.Dispatcher.Initializable make()
public Class<?> findClass(ClassLoader classLoader, String name)
ClassInjector.UsingReflection.Dispatcher
findClass
in interface ClassInjector.UsingReflection.Dispatcher
classLoader
- The class loader for which a class should be located.name
- The binary name of the class that should be located.null
if no such class is defined for the provided class loader.public Class<?> defineClass(ClassLoader classLoader, String name, byte[] binaryRepresentation, ProtectionDomain protectionDomain)
ClassInjector.UsingReflection.Dispatcher
defineClass
in interface ClassInjector.UsingReflection.Dispatcher
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.public Package getPackage(ClassLoader classLoader, String name)
ClassInjector.UsingReflection.Dispatcher
getPackage
in interface ClassInjector.UsingReflection.Dispatcher
classLoader
- The class loader to query.name
- The binary name of the package.null
if no such package exists.public Package definePackage(ClassLoader classLoader, String name, String specificationTitle, String specificationVersion, String specificationVendor, String implementationTitle, String implementationVersion, String implementationVendor, URL sealBase)
ClassInjector.UsingReflection.Dispatcher
definePackage
in interface ClassInjector.UsingReflection.Dispatcher
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 or null
if no specification title exists.specificationVersion
- The specification version of the package or null
if no specification version exists.specificationVendor
- The specification vendor of the package or null
if no specification vendor exists.implementationTitle
- The implementation title of the package or null
if no implementation title exists.implementationVersion
- The implementation version of the package or null
if no implementation version exists.implementationVendor
- The implementation vendor of the package or null
if no implementation vendor exists.sealBase
- The seal base URL or null
if the package should not be sealed.public ClassInjector.UsingReflection.Dispatcher initialize()
ClassInjector.UsingReflection.Dispatcher.Initializable
initialize
in interface ClassInjector.UsingReflection.Dispatcher.Initializable
protected abstract void onInitialization()
Copyright © 2014–2016. All rights reserved.