public class FailoverTargetSelector
extends org.apache.cxf.endpoint.AbstractConduitSelector
| Modifier and Type | Class and Description |
|---|---|
protected class |
FailoverTargetSelector.InvocationContext
Records the context of an invocation.
|
| Modifier and Type | Field and Description |
|---|---|
protected FailoverStrategy |
failoverStrategy |
| Constructor and Description |
|---|
FailoverTargetSelector()
Normal constructor.
|
FailoverTargetSelector(org.apache.cxf.transport.Conduit c)
Constructor, allowing a specific conduit to override normal selection.
|
FailoverTargetSelector(String clientBootstrapAddress) |
| Modifier and Type | Method and Description |
|---|---|
void |
complete(org.apache.cxf.message.Exchange exchange)
Called on completion of the MEP for which the Conduit was required.
|
protected void |
doComplete(org.apache.cxf.message.Exchange exchange) |
String |
getClientBootstrapAddress() |
protected long |
getDelayBetweenRetries()
Returns delay (in milliseconds) between retries
|
protected org.apache.cxf.endpoint.Endpoint |
getFailoverTarget(org.apache.cxf.message.Exchange exchange,
FailoverTargetSelector.InvocationContext invocation)
Get the failover target endpoint, if a suitable one is available.
|
protected FailoverTargetSelector.InvocationContext |
getInvocationContext(String key) |
protected String |
getInvocationKey(org.apache.cxf.message.Exchange e) |
protected Logger |
getLogger() |
FailoverStrategy |
getStrategy() |
boolean |
isSupportNotAvailableErrorsOnly() |
protected void |
onFailure(FailoverTargetSelector.InvocationContext context,
Exception ex) |
protected void |
onSuccess(FailoverTargetSelector.InvocationContext context) |
protected void |
overrideAddressProperty(Map<String,Object> context)
Override the ENDPOINT_ADDRESS property in the request context
|
protected void |
overrideAddressProperty(Map<String,Object> context,
String address) |
protected boolean |
performFailover(org.apache.cxf.message.Exchange exchange,
FailoverTargetSelector.InvocationContext invocation) |
void |
prepare(org.apache.cxf.message.Message message)
Called prior to the interceptor chain being traversed.
|
protected boolean |
replaceEndpointAddressPropertyIfNeeded(org.apache.cxf.message.Message message,
String endpointAddress,
org.apache.cxf.transport.Conduit cond) |
protected boolean |
requiresFailover(org.apache.cxf.message.Exchange exchange,
Exception ex)
Check if the exchange is suitable for a failover.
|
org.apache.cxf.transport.Conduit |
selectConduit(org.apache.cxf.message.Message message)
Called when a Conduit is actually required.
|
void |
setClientBootstrapAddress(String clientBootstrapAddress) |
protected void |
setOriginalEndpoint(FailoverTargetSelector.InvocationContext invocation) |
void |
setStrategy(FailoverStrategy strategy) |
void |
setSupportNotAvailableErrorsOnly(boolean support) |
protected void |
setupExchangeExceptionProperties(org.apache.cxf.message.Exchange ex) |
protected List<String> |
updateContextAlternatives(org.apache.cxf.message.Exchange exchange,
FailoverTargetSelector.InvocationContext invocation)
Fetches and updates the alternative address or/and alternative endpoints
(depending on the strategy) for current invocation context.
|
protected FailoverStrategy failoverStrategy
public FailoverTargetSelector()
public FailoverTargetSelector(String clientBootstrapAddress)
public FailoverTargetSelector(org.apache.cxf.transport.Conduit c)
c - specific conduitpublic void prepare(org.apache.cxf.message.Message message)
message - the current Messageprotected void setupExchangeExceptionProperties(org.apache.cxf.message.Exchange ex)
public org.apache.cxf.transport.Conduit selectConduit(org.apache.cxf.message.Message message)
message - protected FailoverTargetSelector.InvocationContext getInvocationContext(String key)
public void complete(org.apache.cxf.message.Exchange exchange)
complete in interface org.apache.cxf.endpoint.ConduitSelectorcomplete in class org.apache.cxf.endpoint.AbstractConduitSelectorexchange - represents the completed MEPprotected void doComplete(org.apache.cxf.message.Exchange exchange)
protected void setOriginalEndpoint(FailoverTargetSelector.InvocationContext invocation)
protected boolean performFailover(org.apache.cxf.message.Exchange exchange,
FailoverTargetSelector.InvocationContext invocation)
protected void onSuccess(FailoverTargetSelector.InvocationContext context)
protected void onFailure(FailoverTargetSelector.InvocationContext context, Exception ex)
public void setStrategy(FailoverStrategy strategy)
strategy - the FailoverStrategy to usepublic FailoverStrategy getStrategy()
protected Logger getLogger()
getLogger in class org.apache.cxf.endpoint.AbstractConduitSelectorprotected long getDelayBetweenRetries()
protected boolean requiresFailover(org.apache.cxf.message.Exchange exchange,
Exception ex)
exchange - the current Exchangeprotected org.apache.cxf.endpoint.Endpoint getFailoverTarget(org.apache.cxf.message.Exchange exchange,
FailoverTargetSelector.InvocationContext invocation)
exchange - the current Exchangeinvocation - the current InvocationContextprotected List<String> updateContextAlternatives(org.apache.cxf.message.Exchange exchange, FailoverTargetSelector.InvocationContext invocation)
exchange - the current Exchangeinvocation - the current InvocationContextprotected void overrideAddressProperty(Map<String,Object> context)
context - the request contextprotected void overrideAddressProperty(Map<String,Object> context, String address)
protected boolean replaceEndpointAddressPropertyIfNeeded(org.apache.cxf.message.Message message,
String endpointAddress,
org.apache.cxf.transport.Conduit cond)
replaceEndpointAddressPropertyIfNeeded in class org.apache.cxf.endpoint.AbstractConduitSelectorpublic boolean isSupportNotAvailableErrorsOnly()
public void setSupportNotAvailableErrorsOnly(boolean support)
public String getClientBootstrapAddress()
public void setClientBootstrapAddress(String clientBootstrapAddress)
protected String getInvocationKey(org.apache.cxf.message.Exchange e)
Apache CXF