java.util.concurrent.Callable#call()
or Runnable#run()
method is called where the method
call proxy implements both interfaces.
In order to do so, the method call proxy instances are constructed by providing all the necessary information for calling a particular method:
static
, the first argument should be an instance on which the method is called.Modifier and Type | Class and Description |
---|---|
public static class | MethodCallProxy.AssignableSignatureCall
A stack manipulation that creates a |
protected static enum | MethodCallProxy.ConstructorCall
An implementation for a constructor of a |
protected static class | MethodCallProxy.MethodCall
An implementation for a method of a |
protected static enum | MethodCallProxy.PrecomputedMethodGraph
A precomputed method graph that only displays the methods that are relevant for creating a method call proxy. |
Modifier and Type | Field and Description |
---|---|
private final Assigner | assigner
The assigner to use for invoking a bridge method target where the parameter and return types need to be assigned. |
private static final String | FIELD_NAME_PREFIX
The prefix of the fields holding the original method invocation's arguments. |
private final boolean | serializableProxy
Determines if the generated proxy should be serializableProxy. |
private final Implementation. | specialMethodInvocation
The special method invocation to invoke from the auxiliary type. |
Access | Constructor and Description |
---|---|
public | MethodCallProxy(Implementation.
The special method invocation which should be invoked by this method call proxy. specialMethodInvocation,Determines if the generated proxy should be serializableProxy. serializableProxy)Creates a new method call proxy for a given method and uses a default assigner for assigning the method's return
value to either the |
public | MethodCallProxy(Implementation.
The special method invocation which should be invoked by this method call proxy. specialMethodInvocation,Determines if the generated proxy should be serializableProxy. serializableProxy, Assigner An assigner for assigning the target method's return value to either the
assigner)java. or Runnable#run() } methods'
return values.Creates a new method call proxy for a given method. |
Modifier and Type | Method and Description |
---|---|
private static LinkedHashMap | Returns: A map of fields in the order they need to be loaded onto the operand stack for invoking the original method, including a reference to the instance of the instrumented type that is invoked if applicable.The method to extract into fields. methodDescription)Creates a linked hash map of field names to their types where each field represents a parameter of the method. |
private static String | Returns: The name for the given parameter.The index for which the field name is to be created. index)Creates a field name for a method parameter of a given index. |
public String | getSuffix()
Implements net. |
public DynamicType | make(String
The fully qualified binary name for this auxiliary type. The type should be in
the same package than the instrumented type this auxiliary type is providing services
to in order to allow package-private access. auxiliaryTypeName, ClassFileVersion The class file version the auxiliary class should be written in. classFileVersion, MethodAccessorFactory A factory for accessor methods. methodAccessorFactory)Implements net. |
assigner | back to summary |
---|---|
private final Assigner assigner The assigner to use for invoking a bridge method target where the parameter and return types need to be assigned. |
FIELD_NAME_PREFIX | back to summary |
---|---|
private static final String FIELD_NAME_PREFIX The prefix of the fields holding the original method invocation's arguments. |
serializableProxy | back to summary |
---|---|
private final boolean serializableProxy Determines if the generated proxy should be serializableProxy. |
specialMethodInvocation | back to summary |
---|---|
private final Implementation. The special method invocation to invoke from the auxiliary type. |
MethodCallProxy | back to summary |
---|---|
public MethodCallProxy(Implementation. Creates a new method call proxy for a given method and uses a default assigner for assigning the method's return
value to either the
|
MethodCallProxy | back to summary |
---|---|
public MethodCallProxy(Implementation. Creates a new method call proxy for a given method.
|
extractFields | back to summary |
---|---|
private static LinkedHashMap Creates a linked hash map of field names to their types where each field represents a parameter of the method.
|
fieldName | back to summary |
---|---|
private static String fieldName(int index) Creates a field name for a method parameter of a given index.
|
getSuffix | back to summary |
---|---|
public String getSuffix() Implements net. Doc from net. Produces a suffix that gives this auxiliary type a stable name. A best effort is made that this suffix is unique.
|
make | back to summary |
---|---|
public DynamicType make(String auxiliaryTypeName, ClassFileVersion classFileVersion, MethodAccessorFactory methodAccessorFactory) Implements net. Doc from net. Creates a new auxiliary type.
|
net.bytebuddy.implementation.auxiliary.MethodCallProxy
for a given method an pushes such an object onto the call stack. For this purpose, all arguments of the proxied method
are loaded onto the stack what is only possible if this instance is used from a method with an identical signature such
as the target method itself.
Modifier and Type | Field and Description |
---|---|
private final boolean | serializable
Determines if the generated proxy should be serializableProxy. |
private final Implementation. | specialMethodInvocation
The special method invocation to be proxied by this stack manipulation. |
Access | Constructor and Description |
---|---|
public | AssignableSignatureCall(Implementation.
The special method invocation which should be invoked by the created method
call proxy. specialMethodInvocation,Determines if the generated proxy should be serializableProxy. serializable)Creates an operand stack assignment that creates a
|
Modifier and Type | Method and Description |
---|---|
public StackManipulation. | apply(MethodVisitor
The method visitor used to write the method implementation to. methodVisitor, Implementation.The context of the current implementation. implementationContextImplements net. |
serializable | back to summary |
---|---|
private final boolean serializable Determines if the generated proxy should be serializableProxy. |
specialMethodInvocation | back to summary |
---|---|
private final Implementation. The special method invocation to be proxied by this stack manipulation. |
AssignableSignatureCall | back to summary |
---|---|
public AssignableSignatureCall(Implementation. Creates an operand stack assignment that creates a
|
apply | back to summary |
---|---|
public StackManipulation. Implements net. Doc from net. Applies the stack manipulation that is described by this instance.
|
net.bytebuddy.implementation.auxiliary.MethodCallProxy
.
Modifier and Type | Class and Description |
---|---|
protected static class | MethodCallProxy.ConstructorCall.Appender
The appender for implementing the |
Modifier and Type | Field and Description |
---|---|
public static final MethodCallProxy. | INSTANCE
The singleton instance. |
private final MethodDescription | objectTypeDefaultConstructor
A reference of the |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public ByteCodeAppender | appender(Implementation.
The target of the current implementation. implementationTargetImplements net. |
public InstrumentedType | prepare(InstrumentedType
The instrumented type in its current form. instrumentedType)Implements net. |
public static MethodCallProxy. | |
public static MethodCallProxy. |
INSTANCE | back to summary |
---|---|
public static final MethodCallProxy. The singleton instance. |
objectTypeDefaultConstructor | back to summary |
---|---|
private final MethodDescription objectTypeDefaultConstructor A reference of the |
ConstructorCall | back to summary |
---|---|
private ConstructorCall() Creates the constructor call singleton. |
appender | back to summary |
---|---|
public ByteCodeAppender appender(Implementation. Implements net. Doc from net. Creates a byte code appender that determines the implementation of the instrumented type's methods.
|
prepare | back to summary |
---|---|
public InstrumentedType prepare(InstrumentedType instrumentedType) Implements net. Doc from net. Prepares a given instrumented type.
|
valueOf | back to summary |
---|---|
public static MethodCallProxy. |
values | back to summary |
---|---|
public static MethodCallProxy. |
net.bytebuddy.implementation.auxiliary.MethodCallProxy.ConstructorCall
.
Modifier and Type | Field and Description |
---|---|
private final TypeDescription | instrumentedType
The instrumented type being created. |
Access | Constructor and Description |
---|---|
private | Appender(TypeDescription
The instrumented type that is being created. instrumentedType)Creates a new appender. |
Modifier and Type | Method and Description |
---|---|
public ByteCodeAppender. | apply(MethodVisitor
The method visitor to which the byte code appender writes its code to. methodVisitor, Implementation.The implementation context of the current type creation process. implementationContext,The method that is the target of the instrumentation. instrumentedMethod)Implements net. |
instrumentedType | back to summary |
---|---|
private final TypeDescription instrumentedType The instrumented type being created. |
Appender | back to summary |
---|---|
private Appender(TypeDescription instrumentedType) Creates a new appender.
|
apply | back to summary |
---|---|
public ByteCodeAppender. Implements net. Doc from net. Applies this byte code appender to a type creation process.
|
net.bytebuddy.implementation.auxiliary.MethodCallProxy
.
Modifier and Type | Class and Description |
---|---|
protected class | MethodCallProxy.MethodCall.Appender
The appender for implementing the |
Modifier and Type | Field and Description |
---|---|
private final MethodDescription | accessorMethod
The method that is accessed by the implemented method. |
private final Assigner | assigner
The assigner to be used for invoking the accessor method. |
Access | Constructor and Description |
---|---|
protected | MethodCall(MethodDescription
The method that is accessed by the implemented method. accessorMethod, Assigner The assigner to be used for invoking the accessor method. assigner)Creates a new method call implementation. |
Modifier and Type | Method and Description |
---|---|
public ByteCodeAppender | appender(Implementation.
The target of the current implementation. implementationTargetImplements net. |
public InstrumentedType | prepare(InstrumentedType
The instrumented type in its current form. instrumentedType)Implements net. |
accessorMethod | back to summary |
---|---|
private final MethodDescription accessorMethod The method that is accessed by the implemented method. |
assigner | back to summary |
---|---|
private final Assigner assigner The assigner to be used for invoking the accessor method. |
MethodCall | back to summary |
---|---|
protected MethodCall(MethodDescription accessorMethod, Assigner assigner) Creates a new method call implementation.
|
appender | back to summary |
---|---|
public ByteCodeAppender appender(Implementation. Implements net. Doc from net. Creates a byte code appender that determines the implementation of the instrumented type's methods.
|
prepare | back to summary |
---|---|
public InstrumentedType prepare(InstrumentedType instrumentedType) Implements net. Doc from net. Prepares a given instrumented type.
|
net.bytebuddy.implementation.auxiliary.MethodCallProxy.MethodCall
.
Modifier and Type | Field and Description |
---|---|
private final TypeDescription | instrumentedType
The instrumented type that is implemented. |
Access | Constructor and Description |
---|---|
private | Appender(TypeDescription
The instrumented type to be implemented. instrumentedType)Creates a new appender. |
Modifier and Type | Method and Description |
---|---|
public ByteCodeAppender. | apply(MethodVisitor
The method visitor to which the byte code appender writes its code to. methodVisitor, Implementation.The implementation context of the current type creation process. implementationContext,The method that is the target of the instrumentation. instrumentedMethod)Implements net. |
instrumentedType | back to summary |
---|---|
private final TypeDescription instrumentedType The instrumented type that is implemented. |
Appender | back to summary |
---|---|
private Appender(TypeDescription instrumentedType) Creates a new appender.
|
apply | back to summary |
---|---|
public ByteCodeAppender. Implements net. Doc from net. Applies this byte code appender to a type creation process.
|
Modifier and Type | Field and Description |
---|---|
public static final MethodCallProxy. | INSTANCE
The singleton instance. |
private final transient MethodGraph. | methodGraph
The precomputed method graph. |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public MethodGraph. | compile(TypeDefinition
The type to be compiled. typeDefinition)Implements net. |
public MethodGraph. | compile(TypeDescription
The type to be compiled. typeDescription)Implements net.
Deprecated
Compiles the given type into a method graph considering the type to be the viewpoint.
|
public MethodGraph. | compile(TypeDefinition
The type to be compiled. typeDefinition, TypeDescription The view point that determines the method's visibility. viewPoint)Implements net. |
public MethodGraph. | compile(TypeDescription
The type to be compiled. typeDefinition, TypeDescription The view point that determines the method's visibility. viewPoint)Implements net.
Deprecated
Compiles the given type into a method graph.
|
public static MethodCallProxy. | |
public static MethodCallProxy. |
INSTANCE | back to summary |
---|---|
public static final MethodCallProxy. The singleton instance. |
methodGraph | back to summary |
---|---|
private final transient MethodGraph. The precomputed method graph. |
PrecomputedMethodGraph | back to summary |
---|---|
private PrecomputedMethodGraph() Creates the precomputed method graph. |
compile | back to summary |
---|---|
public MethodGraph. Implements net. Doc from net. Compiles the given type into a method graph considering the type to be the viewpoint.
|
compile | back to summary |
---|---|
public MethodGraph. Implements net. Doc from net. Deprecated
Compiles the given type into a method graph considering the type to be the viewpoint.
|
compile | back to summary |
---|---|
public MethodGraph. Implements net. Doc from net. Compiles the given type into a method graph.
|
compile | back to summary |
---|---|
public MethodGraph. Implements net. Doc from net. Deprecated
Compiles the given type into a method graph.
|
valueOf | back to summary |
---|---|
public static MethodCallProxy. |
values | back to summary |
---|---|
public static MethodCallProxy. |