MethodCall.invokeSelf()
instead. Scheduled for removal in Byte Buddy 1.6.@Deprecated public class Forwarding extends Object implements Implementation.Composable
MethodDelegation
Modifier and Type | Class and Description |
---|---|
protected static class |
Forwarding.Appender
Deprecated.
An appender for implementing a
Forwarding operation. |
protected static interface |
Forwarding.PreparationHandler
Deprecated.
A preparation handler is responsible for reading the field containing the forwarding instance.
|
protected static class |
Forwarding.TerminationHandler
Deprecated.
A termination handler is responsible for a method's return.
|
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
Modifier and Type | Field and Description |
---|---|
protected Forwarding.PreparationHandler |
preparationHandler
Deprecated.
A handler for preparing the instrumented type and the field invocation operation.
|
protected Forwarding.TerminationHandler |
terminationHandler
Deprecated.
The termination handler to apply.
|
Modifier | Constructor and Description |
---|---|
protected |
Forwarding(Forwarding.PreparationHandler preparationHandler,
Forwarding.TerminationHandler terminationHandler)
Deprecated.
Creates a new forwarding implementation.
|
Modifier and Type | Method and Description |
---|---|
Implementation |
andThen(Implementation implementation)
Deprecated.
Appends the supplied implementation to this implementation.
|
ByteCodeAppender |
appender(Implementation.Target implementationTarget)
Deprecated.
Creates a byte code appender that determines the implementation of the instrumented type's methods.
|
boolean |
equals(Object object)
Deprecated.
|
int |
hashCode()
Deprecated.
|
InstrumentedType |
prepare(InstrumentedType instrumentedType)
Deprecated.
Prepares a given instrumented type.
|
static Implementation.Composable |
to(Object delegate)
Deprecated.
Forwards all intercepted method invocations to the given instance which is stored in a
static field
of the instrumented class. |
static Implementation.Composable |
to(Object delegate,
String fieldName)
Deprecated.
Forwards all intercepted method invocations to the given instance which is stored in a
static field
of the instrumented class. |
static Implementation.Composable |
to(Object delegate,
String fieldName,
Type type)
Deprecated.
Forwards all intercepted method invocations to the given instance which is stored in a
static field
of the instrumented class. |
static Implementation.Composable |
to(Object delegate,
Type type)
Deprecated.
Forwards all intercepted method invocations to the given instance which is stored in a
static field
of the instrumented class. |
static Implementation.Composable |
toField(String name)
Deprecated.
Delegates a method invocation to a field.
|
static Implementation.Composable |
toField(String name,
FieldLocator.Factory fieldLocatorFactory)
Deprecated.
Delegates a method invocation to a field.
|
String |
toString()
Deprecated.
|
protected final Forwarding.PreparationHandler preparationHandler
protected final Forwarding.TerminationHandler terminationHandler
protected Forwarding(Forwarding.PreparationHandler preparationHandler, Forwarding.TerminationHandler terminationHandler)
preparationHandler
- A handler for preparing the instrumented type and the field invocation operation.terminationHandler
- The termination handler to apply.public static Implementation.Composable to(Object delegate)
static
field
of the instrumented class. The field name is generated from the instance's hash code.delegate
- The delegate to which all intercepted methods should be forwarded.public static Implementation.Composable to(Object delegate, String fieldName)
static
field
of the instrumented class.delegate
- The delegate to which all intercepted methods should be forwarded.fieldName
- The name of the field in which the delegate should be stored.public static Implementation.Composable to(Object delegate, Type type)
static
field
of the instrumented class.delegate
- The delegate to which all intercepted methods should be forwarded.type
- The type of the field. Must be a subtype of the delegate's type.public static Implementation.Composable to(Object delegate, String fieldName, Type type)
static
field
of the instrumented class.delegate
- The delegate to which all intercepted methods should be forwarded.fieldName
- The name of the field in which the delegate should be stored.type
- The type of the field. Must be a subtype of the delegate's type.public static Implementation.Composable toField(String name)
name
- The name of the field.public static Implementation.Composable toField(String name, FieldLocator.Factory fieldLocatorFactory)
name
- The name of the field.fieldLocatorFactory
- The field locator factory to use.public ByteCodeAppender appender(Implementation.Target implementationTarget)
Implementation
appender
in interface Implementation
implementationTarget
- The target of the current implementation.InstrumentedType.Prepareable.prepare(InstrumentedType)
.public Implementation andThen(Implementation implementation)
Implementation.Composable
andThen
in interface Implementation.Composable
implementation
- The subsequent implementation.public InstrumentedType prepare(InstrumentedType instrumentedType)
InstrumentedType.Prepareable
prepare
in interface InstrumentedType.Prepareable
instrumentedType
- The instrumented type in its current form.Copyright © 2014–2016. All rights reserved.