public class FailoverInvoker<T> extends HotSwappingInvoker<T>
Invoker that implements a failover strategy by using different delegates in
case of an exception. The implemented strategy is a simple round-robin algorithm to change the delegate in case of a
relevant exception.HotSwappingInvoker.CycleCheck| Constructor and Description |
|---|
FailoverInvoker(Class<?>[] types,
ProxyFactory proxyFactory,
T[] delegates,
Class<? extends Throwable> exceptionClass)
Construct a FailoverInvoker.
|
| Modifier and Type | Method and Description |
|---|---|
protected Object |
invokeOnDelegate(Method method,
Object[] args)
Invoke the given method on the delegate.
|
delegate, hotswap, invoke, proxyequals, getDelegateReference, getMethodToInvoke, getProxyFactory, hashCodepublic FailoverInvoker(Class<?>[] types, ProxyFactory proxyFactory, T[] delegates, Class<? extends Throwable> exceptionClass)
types - the types of the proxyproxyFactory - the ProxyFactory to usedelegates - the delegates to useexceptionClass - the type of the exceptionprotected Object invokeOnDelegate(Method method, Object[] args) throws InvocationTargetException
DelegatingInvokerinvokeOnDelegate in class DelegatingInvoker<Object>method - the method to invokeargs - the arguments for the invocationInvocationTargetException - if the invoked method throws any exceptionCopyright © 2005–2018 Codehaus. All rights reserved.