|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thoughtworks.proxy.toys.delegate.DelegatingInvoker
com.thoughtworks.proxy.toys.hotswap.HotSwappingInvoker
public class HotSwappingInvoker
A DelegatingInvoker
implementation that allows the exchange of the delegate.
Nested Class Summary | |
---|---|
protected static interface |
HotSwappingInvoker.CycleCheck
Internal interface used to detect cyclic swapping activity. |
Constructor Summary | |
---|---|
HotSwappingInvoker(Class[] types,
ProxyFactory proxyFactory,
ObjectReference delegateReference,
boolean staticTyping)
Deprecated. since 0.2, use HotSwappingInvoker(Class[], ProxyFactory, ObjectReference, int) |
|
HotSwappingInvoker(Class[] types,
ProxyFactory proxyFactory,
ObjectReference delegateReference,
int delegationMode)
Construct a HotSwappingInvoker. |
Method Summary | |
---|---|
protected Object |
delegate()
Retrieve the delegated object in derived classes. |
protected Object |
hotswap(Object newDelegate)
Exchange the current delegate. |
Object |
invoke(Object proxy,
Method method,
Object[] args)
Invocation of a method of the proxied object. |
Object |
proxy()
Create a proxy for this Invoker. |
Methods inherited from class com.thoughtworks.proxy.toys.delegate.DelegatingInvoker |
---|
equals, getDelegateReference, getMethodToInvoke, getProxyFactory, hashCode, invokeOnDelegate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HotSwappingInvoker(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(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
Method Detail |
---|
public Object invoke(Object proxy, Method method, Object[] args) throws 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.
Throwable
- if the invoked method has thrown.protected Object delegate()
DelegatingInvoker
delegate
in class DelegatingInvoker
protected Object hotswap(Object newDelegate)
newDelegate
- the new delegate
IllegalStateException
- if cyclic swapping action is detectedpublic Object proxy()
Swappable
interface.
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |