Package org.apache.cxf.clustering
Class CircuitBreakerTargetSelector
- java.lang.Object
-
- org.apache.cxf.endpoint.AbstractConduitSelector
-
- org.apache.cxf.clustering.FailoverTargetSelector
-
- org.apache.cxf.clustering.CircuitBreakerTargetSelector
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ConduitSelector
public class CircuitBreakerTargetSelector extends FailoverTargetSelector
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.cxf.clustering.FailoverTargetSelector
FailoverTargetSelector.InvocationContext
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_THESHOLDstatic intDEFAULT_TIMEOUT-
Fields inherited from class org.apache.cxf.clustering.FailoverTargetSelector
failoverStrategy
-
Fields inherited from class org.apache.cxf.endpoint.AbstractConduitSelector
CONDUIT_COMPARE_FULL_URL, conduits, endpoint, KEEP_CONDUIT_ALIVE
-
-
Constructor Summary
Constructors Constructor Description CircuitBreakerTargetSelector()CircuitBreakerTargetSelector(int threshold, long timeout)CircuitBreakerTargetSelector(int threshold, long timeout, String clientBootstrapAddress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EndpointgetFailoverTarget(Exchange exchange, FailoverTargetSelector.InvocationContext invocation)Get the failover target endpoint, if a suitable one is available.protected voidonFailure(FailoverTargetSelector.InvocationContext context, Exception ex)protected voidonSuccess(FailoverTargetSelector.InvocationContext context)ConduitselectConduit(Message message)Called when a Conduit is actually required.voidsetStrategy(FailoverStrategy strategy)-
Methods inherited from class org.apache.cxf.clustering.FailoverTargetSelector
complete, doComplete, getClientBootstrapAddress, getDelayBetweenRetries, getInvocationContext, getInvocationKey, getLogger, getStrategy, isSupportNotAvailableErrorsOnly, overrideAddressProperty, overrideAddressProperty, performFailover, prepare, replaceEndpointAddressPropertyIfNeeded, requiresFailover, setClientBootstrapAddress, setOriginalEndpoint, setSupportNotAvailableErrorsOnly, setupExchangeExceptionProperties, updateContextAlternatives
-
Methods inherited from class org.apache.cxf.endpoint.AbstractConduitSelector
close, createConduit, findCompatibleConduit, getEndpoint, getSelectedConduit, removeConduit, setEndpoint
-
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_THESHOLD
public static final int DEFAULT_THESHOLD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CircuitBreakerTargetSelector
public CircuitBreakerTargetSelector(int threshold, long timeout)
-
CircuitBreakerTargetSelector
public CircuitBreakerTargetSelector(int threshold, long timeout, String clientBootstrapAddress)
-
CircuitBreakerTargetSelector
public CircuitBreakerTargetSelector()
-
-
Method Detail
-
setStrategy
public void setStrategy(FailoverStrategy strategy)
- Overrides:
setStrategyin classFailoverTargetSelector- Parameters:
strategy- the FailoverStrategy to use
-
selectConduit
public Conduit selectConduit(Message message)
Description copied from class:FailoverTargetSelectorCalled when a Conduit is actually required.- Specified by:
selectConduitin interfaceConduitSelector- Overrides:
selectConduitin classFailoverTargetSelector- Returns:
- the Conduit to use for mediation of the message
-
getFailoverTarget
protected Endpoint getFailoverTarget(Exchange exchange, FailoverTargetSelector.InvocationContext invocation)
Description copied from class:FailoverTargetSelectorGet the failover target endpoint, if a suitable one is available.- Overrides:
getFailoverTargetin classFailoverTargetSelector- Parameters:
exchange- the current Exchangeinvocation- the current InvocationContext- Returns:
- a failover endpoint if one is available
-
onFailure
protected void onFailure(FailoverTargetSelector.InvocationContext context, Exception ex)
- Overrides:
onFailurein classFailoverTargetSelector
-
onSuccess
protected void onSuccess(FailoverTargetSelector.InvocationContext context)
- Overrides:
onSuccessin classFailoverTargetSelector
-
-