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,org.apache.cxf.endpoint.ConduitSelector
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cxf.clustering.FailoverTargetSelector
FailoverTargetSelector.InvocationContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intFields inherited from class org.apache.cxf.clustering.FailoverTargetSelector
failoverStrategyFields inherited from class org.apache.cxf.endpoint.AbstractConduitSelector
CONDUIT_COMPARE_FULL_URL, conduits, endpoint, KEEP_CONDUIT_ALIVE -
Constructor Summary
ConstructorsConstructorDescriptionCircuitBreakerTargetSelector(int threshold, long timeout) CircuitBreakerTargetSelector(int threshold, long timeout, String clientBootstrapAddress) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.cxf.endpoint.EndpointgetFailoverTarget(org.apache.cxf.message.Exchange exchange, FailoverTargetSelector.InvocationContext invocation) Get the failover target endpoint, if a suitable one is available.protected voidonFailure(FailoverTargetSelector.InvocationContext context, Exception ex) protected voidorg.apache.cxf.transport.ConduitselectConduit(org.apache.cxf.message.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, updateContextAlternativesMethods inherited from class org.apache.cxf.endpoint.AbstractConduitSelector
close, createConduit, findCompatibleConduit, getEndpoint, getSelectedConduit, removeConduit, setEndpoint
-
Field Details
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT- See Also:
-
DEFAULT_THESHOLD
public static final int DEFAULT_THESHOLD- See Also:
-
-
Constructor Details
-
CircuitBreakerTargetSelector
public CircuitBreakerTargetSelector(int threshold, long timeout) -
CircuitBreakerTargetSelector
-
CircuitBreakerTargetSelector
public CircuitBreakerTargetSelector()
-
-
Method Details
-
setStrategy
- Overrides:
setStrategyin classFailoverTargetSelector- Parameters:
strategy- the FailoverStrategy to use
-
selectConduit
public org.apache.cxf.transport.Conduit selectConduit(org.apache.cxf.message.Message message) Description copied from class:FailoverTargetSelectorCalled when a Conduit is actually required.- Specified by:
selectConduitin interfaceorg.apache.cxf.endpoint.ConduitSelector- Overrides:
selectConduitin classFailoverTargetSelector- Returns:
- the Conduit to use for mediation of the message
-
getFailoverTarget
protected org.apache.cxf.endpoint.Endpoint getFailoverTarget(org.apache.cxf.message.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
- Overrides:
onFailurein classFailoverTargetSelector
-
onSuccess
- Overrides:
onSuccessin classFailoverTargetSelector
-