Interface Implementation

All Superinterfaces:
InstrumentedType.Prepareable
All Known Subinterfaces:
FieldAccessor.AssignerConfigurable, FieldAccessor.OwnerTypeLocatable, FieldAccessor.PropertyConfigurable, FixedValue.AssignerConfigurable, Implementation.Composable, InvocationHandlerAdapter.AssignerConfigurable, InvocationHandlerAdapter.WithoutPrivilegeConfiguration
All Known Implementing Classes:
Advice, AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.BridgeMethodImplementation, AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.ConstructorImplementation, AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.FactoryImplementation, AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.LambdaMethodImplementation, AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.SerializationImplementation, ByteBuddy.EnumerationImplementation, ByteBuddy.RecordConstructorStrategy, ByteBuddy.RecordObjectMethod, DefaultMethodCall, EqualsMethod, ExceptionMethod, FieldAccessor, FieldAccessor.ForImplicitProperty, FieldAccessor.ForSetter, FieldAccessor.ForSetter.OfConstantValue, FieldAccessor.ForSetter.OfDefaultValue, FieldAccessor.ForSetter.OfFieldValue, FieldAccessor.ForSetter.OfParameterValue, FieldAccessor.ForSetter.OfReferenceValue, FieldProxy.Binder.FieldGetter, FieldProxy.Binder.FieldSetter, FieldProxy.Binder.InstanceFieldConstructor, FieldProxy.Binder.StaticFieldConstructor, FixedValue, FixedValue.ForArgument, FixedValue.ForConstantValue, FixedValue.ForNullValue, FixedValue.ForOriginType, FixedValue.ForThisValue, FixedValue.ForValue, HashCodeMethod, Implementation.Compound, Implementation.Compound.Composable, Implementation.Simple, Implementation.Simple.ForDispatcher, InvocationHandlerAdapter, InvocationHandlerAdapter.ForField, InvocationHandlerAdapter.ForInstance, InvokeDynamic, InvokeDynamic.AbstractDelegator, InvokeDynamic.WithImplicitArguments, InvokeDynamic.WithImplicitTarget, InvokeDynamic.WithImplicitType, InvokeDynamic.WithImplicitType.OfArgument, InvokeDynamic.WithImplicitType.OfField, InvokeDynamic.WithImplicitType.OfInstance, MethodCall, MethodCall.FieldSetting, MethodCall.WithoutSpecifiedTarget, MethodCallProxy.ConstructorCall, MethodCallProxy.MethodCall, MethodDelegation, Morph.Binder.RedirectionProxy.InstanceFieldConstructor, Morph.Binder.RedirectionProxy.MethodCall, Morph.Binder.RedirectionProxy.StaticFieldConstructor, Pipe.Binder.RedirectionProxy.ConstructorCall, Pipe.Binder.RedirectionProxy.MethodCall, StubMethod, SuperMethodCall, SuperMethodCall.WithoutReturn, ToStringMethod, TypeProxy.MethodCall, TypeProxy.SilentConstruction

public interface Implementation extends InstrumentedType.Prepareable
An implementation is responsible for implementing methods of a dynamically created type as byte code. An implementation is applied in two stages:
  1. The implementation is able to prepare an instrumented type by adding fields and/or helper methods that are required for the methods implemented by this implementation. Furthermore, LoadedTypeInitializers and byte code for the type initializer can be registered for the instrumented type.
  2. Any implementation is required to supply a byte code appender that is responsible for providing the byte code to the instrumented methods that were delegated to this implementation. This byte code appender is also be responsible for providing implementations for the methods added in step 1.

 

An implementation should provide meaningful implementations of both Object.equals(Object) and Object.hashCode() if it wants to avoid to be used twice within the creation of a dynamic type. For two equal implementations only one will be applied on the creation of a dynamic type.
  • Method Details

    • appender

      ByteCodeAppender appender(Implementation.Target implementationTarget)
      Creates a byte code appender that determines the implementation of the instrumented type's methods.
      Parameters:
      implementationTarget - The target of the current implementation.
      Returns:
      A byte code appender for implementing methods delegated to this implementation. This byte code appender is also responsible for handling methods that were added by this implementation on the call to InstrumentedType.Prepareable.prepare(InstrumentedType).