public static class AgentBuilder.Default.InitializationStrategy.SelfInjection extends Object implements AgentBuilder.Default.InitializationStrategy, Implementation, ByteCodeAppender
| Modifier and Type | Class and Description |
|---|---|
static class |
AgentBuilder.Default.InitializationStrategy.SelfInjection.Nexus
This nexus is a global dispatcher for initializing classes with
LoadedTypeInitializers. |
AgentBuilder.Default.InitializationStrategy.NoOp, AgentBuilder.Default.InitializationStrategy.SelfInjectionImplementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.TargetByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.Size| Constructor and Description |
|---|
SelfInjection()
Creates a new self injection strategy.
|
| Modifier and Type | Method and Description |
|---|---|
ByteCodeAppender |
appender(Implementation.Target implementationTarget)
Creates a byte code appender that determines the implementation of the instrumented type's methods.
|
DynamicType.Builder<?> |
apply(DynamicType.Builder<?> builder)
Transforms the instrumented type to implement an appropriate initialization strategy.
|
ByteCodeAppender.Size |
apply(MethodVisitor methodVisitor,
Implementation.Context implementationContext,
MethodDescription instrumentedMethod)
Applies this byte code appender to a type creation process.
|
boolean |
equals(Object other) |
int |
hashCode() |
void |
initialize(Class<?> type,
LoadedTypeInitializer loadedTypeInitializer)
Determines if and how a loaded type initializer is to be applied to a loaded type.
|
InstrumentedType |
prepare(InstrumentedType instrumentedType)
During the preparation phase of an implementation, implementations are eligible to adding fields or methods
to the currently instrumented type.
|
void |
register(String name,
ClassLoader classLoader,
LoadedTypeInitializer loadedTypeInitializer)
Registers a loaded type initializer for a type name and class loader pair.
|
String |
toString() |
public DynamicType.Builder<?> apply(DynamicType.Builder<?> builder)
AgentBuilder.Default.InitializationStrategyapply in interface AgentBuilder.Default.InitializationStrategybuilder - The builder which should implement the initialization strategy.builder with the initialization strategy applied.public void initialize(Class<?> type, LoadedTypeInitializer loadedTypeInitializer)
AgentBuilder.Default.InitializationStrategyinitialize in interface AgentBuilder.Default.InitializationStrategytype - The loaded type.loadedTypeInitializer - The type's loaded type initializer.public InstrumentedType prepare(InstrumentedType instrumentedType)
ImplementationByteCodeAppender that is emitted
on the call to
Implementation.appender(Implementation.Target)
call. On this method call, loaded type initializers can also be added to the instrumented type.prepare in interface ImplementationinstrumentedType - The instrumented type that is the basis of the ongoing instrumentation.public ByteCodeAppender appender(Implementation.Target implementationTarget)
Implementationappender in interface ImplementationimplementationTarget - The target of the current implementation.Implementation.prepare(InstrumentedType).public ByteCodeAppender.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)
ByteCodeAppenderapply in interface ByteCodeAppendermethodVisitor - The method visitor to which the byte code appender writes its code to.implementationContext - The implementation context of the current type creation process.instrumentedMethod - The method that is the target of the instrumentation.public void register(String name, ClassLoader classLoader, LoadedTypeInitializer loadedTypeInitializer)
AgentBuilder.Default.InitializationStrategyregister in interface AgentBuilder.Default.InitializationStrategyname - The name of the type for which the loaded type initializer is to be
registered.classLoader - The class loader of the instrumented type. Might be null if
this class loader represents the bootstrap class loader.loadedTypeInitializer - The loaded type initializer that is being registered.Copyright © 2014–2015. All rights reserved.