protected static class AgentBuilder.Default.ExecutingTransformer extends Object implements ClassFileTransformer
ClassFileTransformer
that implements the enclosing agent builder's
configuration.Modifier and Type | Class and Description |
---|---|
protected static interface |
AgentBuilder.Default.ExecutingTransformer.Factory
A factory for creating a
ClassFileTransformer for the current VM. |
protected static class |
AgentBuilder.Default.ExecutingTransformer.FactoryCreationOption
An action to create an implementation of
AgentBuilder.Default.ExecutingTransformer that support Java 9 modules. |
protected class |
AgentBuilder.Default.ExecutingTransformer.Java9CapableVmDispatcher
A privileged action for transforming a class on a JVM that supports modules.
|
protected class |
AgentBuilder.Default.ExecutingTransformer.LegacyVmDispatcher
A privileged action for transforming a class on a JVM prior to Java 9.
|
Modifier and Type | Field and Description |
---|---|
protected static AgentBuilder.Default.ExecutingTransformer.Factory |
FACTORY
A factory for creating a
ClassFileTransformer that supports the features of the current VM. |
Constructor and Description |
---|
ExecutingTransformer(ByteBuddy byteBuddy,
AgentBuilder.Listener listener,
AgentBuilder.PoolStrategy poolStrategy,
AgentBuilder.TypeStrategy typeStrategy,
AgentBuilder.LocationStrategy locationStrategy,
AgentBuilder.Default.NativeMethodStrategy nativeMethodStrategy,
AgentBuilder.InitializationStrategy initializationStrategy,
AgentBuilder.Default.BootstrapInjectionStrategy bootstrapInjectionStrategy,
AgentBuilder.DescriptionStrategy descriptionStrategy,
AgentBuilder.FallbackStrategy fallbackStrategy,
AgentBuilder.RawMatcher ignoredTypeMatcher,
AgentBuilder.Default.Transformation transformation)
Creates a new class file transformer.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
hashCode() |
String |
toString() |
byte[] |
transform(ClassLoader classLoader,
String internalTypeName,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] binaryRepresentation) |
protected byte[] |
transform(Object rawModule,
String internalTypeName,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] binaryRepresentation)
Applies a transformation for a class that was captured by this
ClassFileTransformer . |
protected static final AgentBuilder.Default.ExecutingTransformer.Factory FACTORY
ClassFileTransformer
that supports the features of the current VM.public ExecutingTransformer(ByteBuddy byteBuddy, AgentBuilder.Listener listener, AgentBuilder.PoolStrategy poolStrategy, AgentBuilder.TypeStrategy typeStrategy, AgentBuilder.LocationStrategy locationStrategy, AgentBuilder.Default.NativeMethodStrategy nativeMethodStrategy, AgentBuilder.InitializationStrategy initializationStrategy, AgentBuilder.Default.BootstrapInjectionStrategy bootstrapInjectionStrategy, AgentBuilder.DescriptionStrategy descriptionStrategy, AgentBuilder.FallbackStrategy fallbackStrategy, AgentBuilder.RawMatcher ignoredTypeMatcher, AgentBuilder.Default.Transformation transformation)
byteBuddy
- The Byte Buddy instance to be used.listener
- The listener to notify on transformations.poolStrategy
- The type locator to use.typeStrategy
- The definition handler to use.locationStrategy
- The location strategy to use.nativeMethodStrategy
- The native method strategy to apply.initializationStrategy
- The initialization strategy to use for transformed types.bootstrapInjectionStrategy
- The injection strategy for injecting classes into the bootstrap class loader.descriptionStrategy
- The description strategy for resolving type descriptions for types.fallbackStrategy
- The fallback strategy to use.ignoredTypeMatcher
- Identifies types that should not be instrumented.transformation
- The transformation object for handling type transformations.public byte[] transform(ClassLoader classLoader, String internalTypeName, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] binaryRepresentation)
transform
in interface ClassFileTransformer
protected byte[] transform(Object rawModule, String internalTypeName, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] binaryRepresentation)
ClassFileTransformer
. Invoking this method
allows to process module information which is available since Java 9.rawModule
- The instrumented class's Java java.lang.reflect.Module
.internalTypeName
- The internal name of the instrumented class.classBeingRedefined
- The loaded Class
being redefined or null
if no such class exists.protectionDomain
- The instrumented type's protection domain.binaryRepresentation
- The class file of the instrumented class in its current state.Copyright © 2014–2016. All rights reserved.