com.thoughtworks.proxy.toys.failover
Class Failover

java.lang.Object
  extended by com.thoughtworks.proxy.toys.failover.Failover

public class Failover
extends Object

Factory for proxy instances handling failover.. Delegates to one object as long as there is no exception, fails over to the next when an exception occurs.

Since:
0.1
Author:
Aslak Hellesøy
See Also:
com.thoughtworks.proxy.toys.failover

Method Summary
static Object object(Class[] types, ProxyFactory proxyFactory, Object[] delegates, Class exceptionClass)
          Create a proxy of a specific types with failover capability using the given objects.
static Object object(Class type, ProxyFactory proxyFactory, Object[] delegates, Class exceptionClass)
          Create a proxy of a specific type with failover capability using the given objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

object

public static Object object(Class type,
                            ProxyFactory proxyFactory,
                            Object[] delegates,
                            Class exceptionClass)
Create a proxy of a specific type with failover capability using the given objects. The provided exception type determins the type of exceptions that trigger the failover.

Parameters:
type - the type of the proxy
proxyFactory - the ProxyFactory to use
delegates - the delegates used for failover
exceptionClass - the type of the exceptions triggering failover
Returns:
the generated proxy
Since:
0.1

object

public static Object object(Class[] types,
                            ProxyFactory proxyFactory,
                            Object[] delegates,
                            Class exceptionClass)
Create a proxy of a specific types with failover capability using the given objects. The provided exception type determins the type of exceptions that trigger the failover.

Parameters:
types - the implemented types of the proxy
proxyFactory - the ProxyFactory to use
delegates - the delegates used for failover
exceptionClass - the type of the exceptions triggering failover
Returns:
the generated proxy
Since:
0.1