@HashCodeAndEqualsPlugin.Enhance public static class ClassInjector.UsingJna extends ClassInjector.AbstractBase
Modifier and Type | Class and Description |
---|---|
protected static interface |
ClassInjector.UsingJna.Dispatcher
A dispatcher for JNA class injection.
|
ClassInjector.AbstractBase, ClassInjector.UsingInstrumentation, ClassInjector.UsingJna, ClassInjector.UsingLookup, ClassInjector.UsingReflection, ClassInjector.UsingUnsafe
ALLOW_EXISTING_TYPES, SUPPRESS_ACCESS_CHECKS
Constructor and Description |
---|
UsingJna(ClassLoader classLoader)
Creates a new unsafe injector for the given class loader with a default protection domain.
|
UsingJna(ClassLoader classLoader,
ProtectionDomain protectionDomain)
Creates a new JNA 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 JNA class injection is available on the current VM.
|
static ClassInjector |
ofBootLoader()
Returns an JNA class injector for the boot class loader.
|
static ClassInjector |
ofPlatformLoader()
Returns an JNA class injector for the platform class loader.
|
static ClassInjector |
ofSystemLoader()
Returns an JNA class injector for the system class loader.
|
inject
public UsingJna(@MaybeNull ClassLoader classLoader)
classLoader
- The class loader to inject classes into or null
for the bootstrap loader.public UsingJna(@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.public static boolean isAvailable()
true
if JNA class injection is available on the current VM.public static ClassInjector ofSystemLoader()
public static ClassInjector ofPlatformLoader()
public static ClassInjector ofBootLoader()
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.Copyright © 2014–2024. All rights reserved.