Package net.bytebuddy.dynamic.loading
Class ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride.ForJava7CapableVm
- java.lang.Object
-
- net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride
-
- net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride.ForJava7CapableVm
-
- All Implemented Interfaces:
ClassInjector.UsingReflection.Dispatcher
,ClassInjector.UsingReflection.Dispatcher.Initializable
- Enclosing class:
- ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride
@Enhance protected static class ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride.ForJava7CapableVm extends ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride
A resolved class dispatcher using unsafe field injection for a class injector on a VM running at least Java 7.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride
ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride.ForJava7CapableVm, ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride.ForLegacyVm
-
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.UsingUnsafeOverride
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher.Initializable
ClassInjector.UsingReflection.Dispatcher.Initializable.Unavailable
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Method
getClassLoadingLock
An instance ofClassLoader#getClassLoadingLock(String)
.-
Fields inherited from class net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride
defineClass, definePackage, findLoadedClass, getDefinedPackage, getPackage
-
Fields inherited from interface net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher
UNDEFINED
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForJava7CapableVm(java.lang.reflect.Method findLoadedClass, java.lang.reflect.Method defineClass, java.lang.reflect.Method getDefinedPackage, java.lang.reflect.Method getPackage, java.lang.reflect.Method definePackage, java.lang.reflect.Method getClassLoadingLock)
Creates a new resolved class injector using unsafe field injection for a VM running at least Java 7.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getClassLoadingLock(java.lang.ClassLoader classLoader, java.lang.String name)
Returns the lock for loading the specified class.-
Methods inherited from class net.bytebuddy.dynamic.loading.ClassInjector.UsingReflection.Dispatcher.UsingUnsafeOverride
defineClass, definePackage, findClass, getDefinedPackage, getPackage, initialize, isAvailable, make
-
-
-
-
Constructor Detail
-
ForJava7CapableVm
protected ForJava7CapableVm(java.lang.reflect.Method findLoadedClass, java.lang.reflect.Method defineClass, java.lang.reflect.Method getDefinedPackage, java.lang.reflect.Method getPackage, java.lang.reflect.Method definePackage, java.lang.reflect.Method getClassLoadingLock)
Creates a new resolved class injector using unsafe field injection for a VM running at least Java 7.- Parameters:
getClassLoadingLock
- An instance ofClassLoader#getClassLoadingLock(String)
.findLoadedClass
- An instance ofClassLoader.findLoadedClass(String)
.defineClass
- An instance ofClassLoader.defineClass(String, byte[], int, int, ProtectionDomain)
.getDefinedPackage
- An instance ofjava.lang.ClassLoader#getDefinedPackage(String)
. May benull
.getPackage
- An instance ofClassLoader.getPackage(String)
.definePackage
- An instance ofClassLoader.definePackage(String, String, String, String, String, String, String, URL)
.
-
-
Method Detail
-
getClassLoadingLock
public java.lang.Object getClassLoadingLock(java.lang.ClassLoader classLoader, java.lang.String name)
Returns the lock for loading the specified class.- Parameters:
classLoader
- the class loader to inject the class into.name
- The name of the class.- Returns:
- The lock for loading this class.
-
-