@HashCodeAndEqualsPlugin.Enhance public static class ClassInjector.UsingInstrumentation extends ClassInjector.AbstractBase
Instrumentation to append to either the boot classpath
or the system class path.| Modifier and Type | Class and Description |
|---|---|
protected static interface |
ClassInjector.UsingInstrumentation.Dispatcher
A dispatcher to interact with the instrumentation API.
|
static class |
ClassInjector.UsingInstrumentation.Target
A representation of the target to which Java classes should be appended to.
|
ClassInjector.AbstractBase, ClassInjector.UsingInstrumentation, ClassInjector.UsingJna, ClassInjector.UsingLookup, ClassInjector.UsingReflection, ClassInjector.UsingUnsafeALLOW_EXISTING_TYPES, SUPPRESS_ACCESS_CHECKS| Modifier | Constructor and Description |
|---|---|
protected |
UsingInstrumentation(File folder,
ClassInjector.UsingInstrumentation.Target target,
Instrumentation instrumentation,
RandomString randomString)
Creates an instrumentation-based class injector.
|
| 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()
Returns
true if this class injector is available on this VM. |
static ClassInjector |
of(File folder,
ClassInjector.UsingInstrumentation.Target target,
Instrumentation instrumentation)
Creates an instrumentation-based class injector.
|
static void |
redefineModule(Instrumentation instrumentation,
JavaModule target,
Set<JavaModule> reads,
Map<String,Set<JavaModule>> exports,
Map<String,Set<JavaModule>> opens,
Set<Class<?>> uses,
Map<Class<?>,List<Class<?>>> provides)
Modifies a module's properties using
Instrumentation. |
injectprotected UsingInstrumentation(File folder, ClassInjector.UsingInstrumentation.Target target, Instrumentation instrumentation, RandomString randomString)
folder - The folder to be used for storing jar files.target - A representation of the target path to which classes are to be appended.instrumentation - The instrumentation to use for appending to the class path or the boot path.randomString - The random string generator to use.public static void redefineModule(Instrumentation instrumentation, JavaModule target, Set<JavaModule> reads, Map<String,Set<JavaModule>> exports, Map<String,Set<JavaModule>> opens, Set<Class<?>> uses, Map<Class<?>,List<Class<?>>> provides)
Instrumentation.instrumentation - The Instrumentation instance to use for applying the modification.target - The target module that should be modified.reads - A set of additional modules this module should read.exports - A map of packages to export to a set of modules.opens - A map of packages to open to a set of modules.uses - A set of provider interfaces to use by this module.provides - A map of provider interfaces to provide by this module mapped to the provider implementations.public static ClassInjector of(File folder, ClassInjector.UsingInstrumentation.Target target, Instrumentation instrumentation)
folder - The folder to be used for storing jar files.target - A representation of the target path to which classes are to be appended.instrumentation - The instrumentation to use for appending to the class path or the boot path.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 this class injector is available on this VM.true if this class injector is available on this VM.Copyright © 2014–2023. All rights reserved.