Class CDORetryExceptionHandler

java.lang.Object
org.eclipse.emf.cdo.session.CDORetryExceptionHandler
All Implemented Interfaces:
CDOSession.ExceptionHandler

public class CDORetryExceptionHandler extends Object implements CDOSession.ExceptionHandler
A session exection handler that retries the failed protocol operation a configurable number of times.
Since:
2.0
Author:
Eike Stepper
  • Field Details

    • RETRY_FOREVER

      public static final int RETRY_FOREVER
      The 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:
      true if retries are unlimited.
    • handleException

      public void handleException(CDOSession session, int attempt, Exception exception) throws Exception
      Specified by:
      handleException in interface CDOSession.ExceptionHandler
      Throws:
      Exception
      Since:
      4.0
    • toString

      public String toString()
      Returns a concise representation of this retry handler.
      Overrides:
      toString in class Object
      Returns:
      the handler description.