com.thoughtworks.proxy.toys.failover
Class Failover<T>

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

public class Failover<T>
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, Paul Hammant
See Also:
com.thoughtworks.proxy.toys.failover

Nested Class Summary
static class Failover.FailoverBuild<T>
           
static class Failover.FailoverExceptingOrBuild<T>
           
static class Failover.FailoverWithOrExceptingOrBuild<T>
           
 
Method Summary
static
<T> Failover.FailoverWithOrExceptingOrBuild<T>
proxy(Class<T> type)
          Creates a factory for proxy instances handling failover situations.
static
<T> Failover.FailoverWithOrExceptingOrBuild<T>
proxy(Class<T> primaryType, Class<?>... types)
          Creates a factory for proxy instances handling failover situations.
static
<T> Failover.FailoverExceptingOrBuild<T>
proxy(T... delegates)
          Creates a factory for proxy instances handling failover situations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

proxy

public static <T> Failover.FailoverWithOrExceptingOrBuild<T> proxy(Class<T> type)
Creates a factory for proxy instances handling failover situations.

Parameters:
type - the types of the proxy
Returns:
a factory that will proxy instances of the supplied type.
Since:
1.0

proxy

public static <T> Failover.FailoverWithOrExceptingOrBuild<T> proxy(Class<T> primaryType,
                                                                   Class<?>... types)
Creates a factory for proxy instances handling failover situations.

Parameters:
primaryType - the primary type implemented by the proxy
types - other types that are implemented by the proxy
Returns:
a factory that will proxy instances of the supplied type.
Since:
1.0

proxy

public static <T> Failover.FailoverExceptingOrBuild<T> proxy(T... delegates)
Creates a factory for proxy instances handling failover situations.

Parameters:
delegates - the array with the delegates in a failover situation
Returns:
a factory that will proxy instances of the supplied type.
Since:
1.0


Copyright © 2005-2010 Codehaus. All Rights Reserved.