public class FailoverTargetSelector extends AbstractConduitSelector
Modifier and Type | Class and Description |
---|---|
protected class |
FailoverTargetSelector.InvocationContext
Records the context of an invocation.
|
protected static class |
FailoverTargetSelector.InvocationKey
Used to wrap an Exchange for usage as a Map key.
|
Modifier and Type | Field and Description |
---|---|
protected FailoverStrategy |
failoverStrategy |
protected Map<FailoverTargetSelector.InvocationKey,FailoverTargetSelector.InvocationContext> |
inProgress |
endpoint, KEEP_CONDUIT_ALIVE, selectedConduit
Constructor and Description |
---|
FailoverTargetSelector()
Normal constructor.
|
FailoverTargetSelector(Conduit c)
Constructor, allowing a specific conduit to override normal selection.
|
Modifier and Type | Method and Description |
---|---|
void |
complete(Exchange exchange)
Called on completion of the MEP for which the Conduit was required.
|
protected long |
getDelayBetweenRetries()
Returns delay (in milliseconds) between retries
|
protected Endpoint |
getFailoverTarget(Exchange exchange,
FailoverTargetSelector.InvocationContext invocation)
Get the failover target endpoint, if a suitable one is available.
|
protected Logger |
getLogger() |
FailoverStrategy |
getStrategy() |
protected void |
overrideAddressProperty(Map<String,Object> context)
Override the ENDPOINT_ADDRESS property in the request context
|
void |
prepare(Message message)
Called prior to the interceptor chain being traversed.
|
protected boolean |
requiresFailover(Exchange exchange)
Check if the exchange is suitable for a failover.
|
Conduit |
selectConduit(Message message)
Called when a Conduit is actually required.
|
void |
setStrategy(FailoverStrategy strategy) |
close, getEndpoint, getSelectedConduit, replaceEndpointAddressPropertyIfNeeded, setEndpoint
protected Map<FailoverTargetSelector.InvocationKey,FailoverTargetSelector.InvocationContext> inProgress
protected FailoverStrategy failoverStrategy
public FailoverTargetSelector()
public FailoverTargetSelector(Conduit c)
c
- specific conduitpublic void prepare(Message message)
message
- the current Messagepublic Conduit selectConduit(Message message)
message
- public void complete(Exchange exchange)
complete
in interface ConduitSelector
complete
in class AbstractConduitSelector
exchange
- represents the completed MEPpublic void setStrategy(FailoverStrategy strategy)
strategy
- the FailoverStrategy to usepublic FailoverStrategy getStrategy()
protected Logger getLogger()
getLogger
in class AbstractConduitSelector
protected long getDelayBetweenRetries()
protected boolean requiresFailover(Exchange exchange)
exchange
- the current Exchangeprotected Endpoint getFailoverTarget(Exchange exchange, FailoverTargetSelector.InvocationContext invocation)
exchange
- the current Exchangeinvocation
- the current InvocationContextApache CXF