@HashCodeAndEqualsPlugin.Enhance public static class AgentBuilder.Listener.ModuleReadEdgeCompleting extends AgentBuilder.Listener.Adapter
AgentBuilder.Listener.Adapter, AgentBuilder.Listener.Compound, AgentBuilder.Listener.Filtering, AgentBuilder.Listener.ModuleReadEdgeCompleting, AgentBuilder.Listener.NoOp, AgentBuilder.Listener.StreamWriting, AgentBuilder.Listener.WithErrorsOnly, AgentBuilder.Listener.WithTransformationsOnly
Modifier and Type | Field and Description |
---|---|
private boolean |
addTargetEdge
true if the listener should also add a read-edge from the supplied modules to the instrumented type's module. |
private java.lang.instrument.Instrumentation |
instrumentation
The instrumentation instance used for adding read edges.
|
private java.util.Set<? extends JavaModule> |
modules
The modules to add as a read edge to any transformed class's module.
|
LOADED
Constructor and Description |
---|
ModuleReadEdgeCompleting(java.lang.instrument.Instrumentation instrumentation,
boolean addTargetEdge,
java.util.Set<? extends JavaModule> modules)
Creates a new module read-edge completing listener.
|
Modifier and Type | Method and Description |
---|---|
static AgentBuilder.Listener |
of(java.lang.instrument.Instrumentation instrumentation,
boolean addTargetEdge,
java.lang.Class<?>... type)
Resolves a listener that adds module edges from and to the instrumented type's module.
|
void |
onTransformation(TypeDescription typeDescription,
java.lang.ClassLoader classLoader,
JavaModule module,
boolean loaded,
DynamicType dynamicType)
Invoked prior to a successful transformation being applied.
|
onComplete, onDiscovery, onError, onIgnored
private final java.lang.instrument.Instrumentation instrumentation
private final boolean addTargetEdge
true
if the listener should also add a read-edge from the supplied modules to the instrumented type's module.private final java.util.Set<? extends JavaModule> modules
public ModuleReadEdgeCompleting(java.lang.instrument.Instrumentation instrumentation, boolean addTargetEdge, java.util.Set<? extends JavaModule> modules)
instrumentation
- The instrumentation instance used for adding read edges.addTargetEdge
- true
if the listener should also add a read-edge from the supplied modules
to the instrumented type's module.modules
- The modules to add as a read edge to any transformed class's module.public static AgentBuilder.Listener of(java.lang.instrument.Instrumentation instrumentation, boolean addTargetEdge, java.lang.Class<?>... type)
instrumentation
- The instrumentation instance used for adding read edges.addTargetEdge
- true
if the listener should also add a read-edge from the supplied
modules to the instrumented type's module.type
- The types for which to extract the modules.public void onTransformation(TypeDescription typeDescription, java.lang.ClassLoader classLoader, JavaModule module, boolean loaded, DynamicType dynamicType)
AgentBuilder.Listener.Adapter
onTransformation
in interface AgentBuilder.Listener
onTransformation
in class AgentBuilder.Listener.Adapter
typeDescription
- The type that is being transformed.classLoader
- The class loader which is loading this type.module
- The transformed type's module or null
if the current VM does not support modules.loaded
- true
if the type is already loaded.dynamicType
- The dynamic type that was created.