Package org.eclipse.emf.cdo.session
Class CDORetryExceptionHandler
java.lang.Object
org.eclipse.emf.cdo.session.CDORetryExceptionHandler
- All Implemented Interfaces:
CDOSession.ExceptionHandler
A
session exection handler that retries the failed protocol operation a configurable number
of times.- Since:
- 2.0
- Author:
- Eike Stepper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe value used to retry a failed operation without a retry limit. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a retry handler that retries forever.CDORetryExceptionHandler(int retries) Creates a retry handler with the given retry limit. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the configured retry limit.voidhandleException(CDOSession session, int attempt, Exception exception) booleanReturns whether this handler retries without a limit.toString()Returns a concise representation of this retry handler.
-
Field Details
-
RETRY_FOREVER
public static final int RETRY_FOREVERThe value used to retry a failed operation without a retry limit.- See Also:
-
-
Constructor Details
-
CDORetryExceptionHandler
public CDORetryExceptionHandler(int retries) Creates a retry handler with the given retry limit.- Parameters:
retries- the maximum number of retries, or a negative value to retry forever.
-
CDORetryExceptionHandler
public CDORetryExceptionHandler()Creates a retry handler that retries forever.
-
-
Method Details
-
getRetries
public int getRetries()Returns the configured retry limit.- Returns:
- the retry limit.
-
isRetryingForever
public boolean isRetryingForever()Returns whether this handler retries without a limit.- Returns:
trueif retries are unlimited.
-
handleException
- Specified by:
handleExceptionin interfaceCDOSession.ExceptionHandler- Throws:
Exception- Since:
- 4.0
-
toString
Returns a concise representation of this retry handler.
-