Class AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.SerializationImplementation
java.lang.Object
net.bytebuddy.agent.builder.AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.SerializationImplementation
- All Implemented Interfaces:
InstrumentedType.Prepareable, Implementation
- Enclosing class:
AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory
@Enhance
protected static class AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.SerializationImplementation
extends Object
implements Implementation
Implements the
writeReplace method for serializable lambda expressions.-
Nested Class Summary
Nested classes/interfaces inherited from interface Implementation
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.TargetNested classes/interfaces inherited from interface InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOp -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JavaConstant.MethodTypeThe method type of the lambda expression's functional method.private final StringThe lambda expression's functional method name.private final TypeDescriptionThe lambda expression's functional type.private final JavaConstant.MethodTypeThe specialized method type of the lambda expression's functional method.private final JavaConstant.MethodHandleA handle that references the lambda expressions invocation target.private final TypeDescriptionThe lambda expression's declaring type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSerializationImplementation(TypeDescription targetType, TypeDescription lambdaType, String lambdaMethodName, JavaConstant.MethodType lambdaMethod, JavaConstant.MethodHandle targetMethod, JavaConstant.MethodType specializedMethod) Creates a new implementation for a serializable's lambda expression'swriteReplacemethod. -
Method Summary
Modifier and TypeMethodDescriptionappender(Implementation.Target implementationTarget) Creates a byte code appender that determines the implementation of the instrumented type's methods.prepare(InstrumentedType instrumentedType) Prepares a given instrumented type.
-
Field Details
-
targetType
The lambda expression's declaring type. -
lambdaType
The lambda expression's functional type. -
lambdaMethodName
The lambda expression's functional method name. -
lambdaMethod
The method type of the lambda expression's functional method. -
targetMethod
A handle that references the lambda expressions invocation target. -
specializedMethod
The specialized method type of the lambda expression's functional method.
-
-
Constructor Details
-
SerializationImplementation
protected SerializationImplementation(TypeDescription targetType, TypeDescription lambdaType, String lambdaMethodName, JavaConstant.MethodType lambdaMethod, JavaConstant.MethodHandle targetMethod, JavaConstant.MethodType specializedMethod) Creates a new implementation for a serializable's lambda expression'swriteReplacemethod.- Parameters:
targetType- The lambda expression's declaring type.lambdaType- The lambda expression's functional type.lambdaMethodName- The lambda expression's functional method name.lambdaMethod- The method type of the lambda expression's functional method.targetMethod- A handle that references the lambda expressions invocation target.specializedMethod- The specialized method type of the lambda expression's functional method.
-
-
Method Details
-
appender
Creates a byte code appender that determines the implementation of the instrumented type's methods.- Specified by:
appenderin interfaceImplementation- 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).
-
prepare
Prepares a given instrumented type.- Specified by:
preparein interfaceInstrumentedType.Prepareable- Parameters:
instrumentedType- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-