|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.thoughtworks.proxy.toys.delegate.DelegatingInvoker<Object>
com.thoughtworks.proxy.toys.hotswap.HotSwappingInvoker<T>
public class HotSwappingInvoker<T>
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<Object> delegateReference,
DelegationMode 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. |
T |
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<Object> delegateReference,
DelegationMode delegationMode)
types - the types of the proxyproxyFactory - the ProxyFactory to usedelegateReference - the ObjectReference with the delegatedelegationMode - DelegationMode.DIRECT or DelegationMode.SIGNATURE| Method Detail |
|---|
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
Invoker
invoke in interface Invokerinvoke in class DelegatingInvoker<Object>proxy - the proxy instance.method - the method to invoke.args - the arguments of the method.
Throwable - if the invoked method has thrown.protected Object delegate()
DelegatingInvoker
delegate in class DelegatingInvoker<Object>protected Object hotswap(Object newDelegate)
newDelegate - the new delegate
IllegalStateException - if cyclic swapping action is detectedpublic T proxy()
Swappable interface.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||