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. |
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.TypeLocator typeLocator,
AgentBuilder.TypeStrategy typeStrategy,
AgentBuilder.Listener listener,
AgentBuilder.Default.NativeMethodStrategy nativeMethodStrategy,
AccessControlContext accessControlContext,
AgentBuilder.InitializationStrategy initializationStrategy,
AgentBuilder.Default.BootstrapInjectionStrategy bootstrapInjectionStrategy,
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.TypeLocator typeLocator, AgentBuilder.TypeStrategy typeStrategy, AgentBuilder.Listener listener, AgentBuilder.Default.NativeMethodStrategy nativeMethodStrategy, AccessControlContext accessControlContext, AgentBuilder.InitializationStrategy initializationStrategy, AgentBuilder.Default.BootstrapInjectionStrategy bootstrapInjectionStrategy, AgentBuilder.RawMatcher ignoredTypeMatcher, AgentBuilder.Default.Transformation transformation)
byteBuddy
- The Byte Buddy instance to be used.typeLocator
- The type locator to use.typeStrategy
- The definition handler to use.listener
- The listener to notify on transformations.nativeMethodStrategy
- The native method strategy to apply.accessControlContext
- The access control context to use for loading classes.initializationStrategy
- The initialization strategy to use for transformed types.bootstrapInjectionStrategy
- The injection strategy for injecting classes into the bootstrap class loader.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
.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.