public class HotSwappingInvoker extends DelegatingInvoker
DelegatingInvoker
implementation that allows the exchange of the delegate.Modifier and Type | Class and Description |
---|---|
protected static interface |
HotSwappingInvoker.CycleCheck
Internal interface used to detect cyclic swapping activity.
|
Constructor and Description |
---|
HotSwappingInvoker(java.lang.Class[] types,
ProxyFactory proxyFactory,
ObjectReference delegateReference,
boolean staticTyping)
Deprecated.
|
HotSwappingInvoker(java.lang.Class[] types,
ProxyFactory proxyFactory,
ObjectReference delegateReference,
int delegationMode)
Construct a HotSwappingInvoker.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
delegate()
Retrieve the delegated object in derived classes.
|
protected java.lang.Object |
hotswap(java.lang.Object newDelegate)
Exchange the current delegate.
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Invocation of a method of the proxied object.
|
java.lang.Object |
proxy()
Create a proxy for this Invoker.
|
equals, getDelegateReference, getMethodToInvoke, getProxyFactory, hashCode, invokeOnDelegate
public HotSwappingInvoker(java.lang.Class[] types, ProxyFactory proxyFactory, ObjectReference delegateReference, int delegationMode)
types
- the types of the proxyproxyFactory
- the ProxyFactory
to usedelegateReference
- the ObjectReference
with the delegatedelegationMode
- MODE_DIRECT
or
MODE_SIGNATURE
public HotSwappingInvoker(java.lang.Class[] types, ProxyFactory proxyFactory, ObjectReference delegateReference, boolean staticTyping)
HotSwappingInvoker(Class[], ProxyFactory, ObjectReference, int)
types
- the types of the proxyproxyFactory
- the ProxyFactory
to usedelegateReference
- the ObjectReference
with the delegatestaticTyping
- STATIC_TYPING
or
DYNAMIC_TYPING
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
Invoker
invoke
in interface Invoker
invoke
in class DelegatingInvoker
proxy
- the proxy instance.method
- the method to invoke.args
- the arguments of the mothod.java.lang.Throwable
- if the invoked method has thrown.protected java.lang.Object delegate()
DelegatingInvoker
delegate
in class DelegatingInvoker
protected java.lang.Object hotswap(java.lang.Object newDelegate)
newDelegate
- the new delegatejava.lang.IllegalStateException
- if cyclic swapping action is detectedpublic java.lang.Object proxy()
Swappable
interface.