Apache CXF API

org.apache.cxf.clustering
Class AbstractStaticFailoverStrategy

java.lang.Object
  extended by org.apache.cxf.clustering.AbstractStaticFailoverStrategy
All Implemented Interfaces:
FailoverStrategy
Direct Known Subclasses:
RandomStrategy, SequentialStrategy

public abstract class AbstractStaticFailoverStrategy
extends java.lang.Object
implements FailoverStrategy

Failover strategy based on a static cluster represented by multiple endpoints associated with the same service instance.


Constructor Summary
AbstractStaticFailoverStrategy()
           
 
Method Summary
 java.util.List<java.lang.String> getAlternateAddresses(Exchange exchange)
          Get the alternate addresses for this invocation.
 java.util.List<Endpoint> getAlternateEndpoints(Exchange exchange)
          Get the alternate endpoints for this invocation.
protected  java.util.List<Endpoint> getEndpoints(Exchange exchange, boolean acceptCandidatesWithSameAddress)
          Get the endpoints for this invocation.
protected abstract
<T> T
getNextAlternate(java.util.List<T> alternates)
          Get next alternate endpoint.
 java.lang.String selectAlternateAddress(java.util.List<java.lang.String> alternates)
          Select one of the alternate addresses for a retried invocation.
 Endpoint selectAlternateEndpoint(java.util.List<Endpoint> alternates)
          Select one of the alternate endpoints for a retried invocation.
 void setAlternateAddresses(java.util.List<java.lang.String> alternateAddresses)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStaticFailoverStrategy

public AbstractStaticFailoverStrategy()
Method Detail

setAlternateAddresses

public void setAlternateAddresses(java.util.List<java.lang.String> alternateAddresses)

getAlternateAddresses

public java.util.List<java.lang.String> getAlternateAddresses(Exchange exchange)
Get the alternate addresses for this invocation.

Specified by:
getAlternateAddresses in interface FailoverStrategy
Parameters:
exchange - the current Exchange
Returns:
a List of alternate addresses if available

selectAlternateAddress

public java.lang.String selectAlternateAddress(java.util.List<java.lang.String> alternates)
Select one of the alternate addresses for a retried invocation.

Specified by:
selectAlternateAddress in interface FailoverStrategy
Parameters:
a - List of alternate addresses if available
Returns:
the selected address

getAlternateEndpoints

public java.util.List<Endpoint> getAlternateEndpoints(Exchange exchange)
Get the alternate endpoints for this invocation.

Specified by:
getAlternateEndpoints in interface FailoverStrategy
Parameters:
exchange - the current Exchange
Returns:
a List of alternate endpoints if available

selectAlternateEndpoint

public Endpoint selectAlternateEndpoint(java.util.List<Endpoint> alternates)
Select one of the alternate endpoints for a retried invocation.

Specified by:
selectAlternateEndpoint in interface FailoverStrategy
Parameters:
a - List of alternate endpoints if available
Returns:
the selected endpoint

getEndpoints

protected java.util.List<Endpoint> getEndpoints(Exchange exchange,
                                                boolean acceptCandidatesWithSameAddress)
Get the endpoints for this invocation.

Parameters:
exchange - the current Exchange
acceptCandidatesWithSameAddress - true to accept candidates with the same address
Returns:
a List of alternate endpoints if available

getNextAlternate

protected abstract <T> T getNextAlternate(java.util.List<T> alternates)
Get next alternate endpoint.

Parameters:
alternates - non-empty List of alternate endpoints
Returns:

Apache CXF API

Apache CXF