Package org.distributeme.core.failing
Class FailoverAndReturn
java.lang.Object
org.distributeme.core.routing.AbstractRouter
org.distributeme.core.failing.FailoverAndReturn
- All Implemented Interfaces:
FailingStrategy,RegistrationNameProvider,Router
- Direct Known Subclasses:
FailoverAndReturnInAMinute,FailoverAndReturnInTenSeconds,FailoverAndReturnWithConfigurableBlacklisting
public abstract class FailoverAndReturn
extends AbstractRouter
implements FailingStrategy, RegistrationNameProvider, Router
This is base class for failing strategy / router combination which is pretty much the same as Failover, but instead of staying on
the failover instance forever, it tries to switch back after some timeout.
- Version:
- $Id: $Id
- Author:
- another
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncallFailed(ClientSideCallContext context) What should happen if a call is failed.voidThis is old style customize.protected abstract longReturns the time unit in milliseconds between the router retries to get back to original server.getRegistrationName(String serviceId) Returns the registration name for this service instance.getServiceIdForCall(ClientSideCallContext callContext) Returns the serviceId for this particular call to route to.protected StringgetSuffix.Methods inherited from class org.distributeme.core.routing.AbstractRouter
customize, getRoutingStats, setServiceId
-
Field Details
-
SECOND
protected static final long SECONDSeconds in ms.- See Also:
-
MINUTE
protected static final long MINUTEMinutes in ms.- See Also:
-
SUFFIX
Suffix of the failover instance.- See Also:
-
-
Constructor Details
-
FailoverAndReturn
public FailoverAndReturn()
-
-
Method Details
-
getFailbackTimeout
protected abstract long getFailbackTimeout()Returns the time unit in milliseconds between the router retries to get back to original server.- Returns:
- a long.
-
getServiceIdForCall
Returns the serviceId for this particular call to route to.- Specified by:
getServiceIdForCallin interfaceRouter- Parameters:
callContext- context of the call with all call related data.- Returns:
- a
Stringobject.
-
getRegistrationName
Returns the registration name for this service instance.- Specified by:
getRegistrationNamein interfaceRegistrationNameProvider- Parameters:
serviceId- aStringobject.- Returns:
- a
Stringobject.
-
customize
This is old style customize. It is called by the 'new' customize.- Specified by:
customizein interfaceRegistrationNameProvider- Overrides:
customizein classAbstractRouter- Parameters:
parameter- aStringobject.
-
callFailed
What should happen if a call is failed.- Specified by:
callFailedin interfaceFailingStrategy- Parameters:
context- aClientSideCallContextobject.- Returns:
- a
FailDecisionobject.
-
getSuffix
getSuffix.
- Returns:
- a
Stringobject.
-