@HashCodeAndEqualsPlugin.Enhance public static class ClassInjector.UsingUnsafe extends ClassInjector.AbstractBase
sun.misc.Unsafe or jdk.internal.misc.Unsafe to inject classes.| Modifier and Type | Class and Description | 
|---|---|
| protected static interface  | ClassInjector.UsingUnsafe.DispatcherA dispatcher for using  sun.misc.Unsafeorjdk.internal.misc.Unsafe. | 
| static class  | ClassInjector.UsingUnsafe.FactoryA factory for creating a  ClassInjectorthat usessun.misc.Unsafeif available but attempts a fallback
 to usingjdk.internal.misc.Unsafeif thejdk.internalmodule is not resolved or unavailable. | 
| protected static interface  | ClassInjector.UsingUnsafe.SystemA proxy of  java.lang.System. | 
ClassInjector.AbstractBase, ClassInjector.UsingInstrumentation, ClassInjector.UsingJna, ClassInjector.UsingLookup, ClassInjector.UsingReflection, ClassInjector.UsingUnsafe| Modifier and Type | Field and Description | 
|---|---|
| static String | SAFE_PROPERTYIf this property is set, Byte Buddy does not make use of any  Unsafeclass. | 
ALLOW_EXISTING_TYPES, SUPPRESS_ACCESS_CHECKS| Modifier | Constructor and Description | 
|---|---|
|   | UsingUnsafe(ClassLoader classLoader)Creates a new unsafe injector for the given class loader with a default protection domain. | 
|   | UsingUnsafe(ClassLoader classLoader,
           ProtectionDomain protectionDomain)Creates a new unsafe injector for the given class loader with a default protection domain. | 
| protected  | UsingUnsafe(ClassLoader classLoader,
           ProtectionDomain protectionDomain,
           ClassInjector.UsingUnsafe.Dispatcher.Initializable dispatcher)Creates a new unsafe injector for the given class loader with a default protection domain. | 
| Modifier and Type | Method and Description | 
|---|---|
| Map<String,Class<?>> | injectRaw(Map<? extends String,byte[]> types)Injects the given types into the represented class loader using a mapping from name to binary representation. | 
| boolean | isAlive()Indicates if this class injector is available on the current VM. | 
| static boolean | isAvailable()Checks if unsafe class injection is available on the current VM. | 
| static ClassInjector | ofBootLoader()Returns an unsafe class injector for the boot class loader. | 
| static ClassInjector | ofPlatformLoader()Returns an unsafe class injector for the platform class loader. | 
| static ClassInjector | ofSystemLoader()Returns an unsafe class injector for the system class loader. | 
injectpublic static final String SAFE_PROPERTY
Unsafe class.public UsingUnsafe(@MaybeNull ClassLoader classLoader)
classLoader - The class loader to inject classes into or null for the bootstrap loader.public UsingUnsafe(@MaybeNull ClassLoader classLoader, @MaybeNull ProtectionDomain protectionDomain)
classLoader - The class loader to inject classes into or null for the bootstrap loader.protectionDomain - The protection domain to use or null for no protection domain.protected UsingUnsafe(@MaybeNull ClassLoader classLoader, @MaybeNull ProtectionDomain protectionDomain, ClassInjector.UsingUnsafe.Dispatcher.Initializable dispatcher)
classLoader - The class loader to inject classes into or null for the bootstrap loader.protectionDomain - The protection domain to use or null for no protection domain.dispatcher - The dispatcher to use.public boolean isAlive()
true if this injector is available on the current VM.public Map<String,Class<?>> injectRaw(Map<? extends String,byte[]> types)
types - The types to load via injection.public static boolean isAvailable()
true if unsafe class injection is available on the current VM.public static ClassInjector ofSystemLoader()
public static ClassInjector ofPlatformLoader()
public static ClassInjector ofBootLoader()
Copyright © 2014–2024. All rights reserved.