protected static class InvocationHandlerAdapter.ForInstance extends InvocationHandlerAdapter implements InvocationHandlerAdapter.AssignerConfigurable
InvocationHandlerAdapter
that delegates method
invocations to an adapter that is stored in a static field.Modifier and Type | Class and Description |
---|---|
protected class |
InvocationHandlerAdapter.ForInstance.Appender
An appender for implementing the
InvocationHandlerAdapter.ForInstance . |
InvocationHandlerAdapter.AssignerConfigurable, InvocationHandlerAdapter.ForField, InvocationHandlerAdapter.ForInstance
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
Modifier and Type | Field and Description |
---|---|
protected InvocationHandler |
invocationHandler
The invocation handler to which method interceptions are to be delegated.
|
assigner, cacheMethods, CACHING, fieldName
Modifier | Constructor and Description |
---|---|
protected |
ForInstance(String fieldName,
boolean cacheMethods,
Assigner assigner,
InvocationHandler invocationHandler)
Creates a new invocation handler adapter for delegating invocations to an invocation handler that is stored
in a static field.
|
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.
|
boolean |
equals(Object other) |
int |
hashCode() |
InstrumentedType |
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.
|
String |
toString() |
Implementation |
withAssigner(Assigner assigner)
Configures an assigner to use with this invocation handler adapter.
|
InvocationHandlerAdapter.AssignerConfigurable |
withoutMethodCache()
By default, any
Method instance that is handed over to an
InvocationHandler is cached in a static field. |
protected final InvocationHandler invocationHandler
protected ForInstance(String fieldName, boolean cacheMethods, Assigner assigner, InvocationHandler invocationHandler)
fieldName
- The name of the field.cacheMethods
- Determines if the Method
instances that are handed to the
intercepted methods are cached in static
fields.assigner
- The assigner to apply when defining this implementation.invocationHandler
- The invocation handler to which all method calls are delegated.public InvocationHandlerAdapter.AssignerConfigurable withoutMethodCache()
InvocationHandlerAdapter
Method
instance that is handed over to an
InvocationHandler
is cached in a static field. By invoking this method,
this feature can be disabled.withoutMethodCache
in class InvocationHandlerAdapter
public Implementation withAssigner(Assigner assigner)
InvocationHandlerAdapter.AssignerConfigurable
withAssigner
in interface InvocationHandlerAdapter.AssignerConfigurable
assigner
- The assigner to apply when defining this implementation.assigner
configured.public InstrumentedType prepare(InstrumentedType instrumentedType)
InstrumentedType.Prepareable
prepare
in interface InstrumentedType.Prepareable
instrumentedType
- The instrumented type in its current form.public ByteCodeAppender appender(Implementation.Target implementationTarget)
Implementation
appender
in interface Implementation
implementationTarget
- The target of the current implementation.InstrumentedType.Prepareable.prepare(InstrumentedType)
.public boolean equals(Object other)
equals
in class InvocationHandlerAdapter
public int hashCode()
hashCode
in class InvocationHandlerAdapter
Copyright © 2014–2017. All rights reserved.