Class RoleViolationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.terracottatech.store.coordination.RoleViolationException
All Implemented Interfaces:
Serializable

public class RoleViolationException extends Exception
Thrown to indicate a role violation while attempting to execute a task.

If the associated task:

  • has not been executed then the getResult() method will throw IllegalStateException.
  • terminated normally then the getResult() method will return the result of the task.
  • terminated exceptionally then the getResult() method will throw an ExecutionException wrapping the original failure. The same exception will also be attached as a suppressed exception of this RoleViolationException.
See Also:
  • Method Details

    • getResult

      public <R> R getResult() throws ExecutionException, IllegalStateException
      Return the result of the associated role task execution.

      If the associated task completed normally then the result will be returned. If the the task completed exceptionally then an ExecutionException will be thrown wrapping the exception thrown by the task.

      Type Parameters:
      R - unbound result parameter
      Returns:
      the result of associated role task
      Throws:
      ExecutionException - if the associated task failed
      IllegalStateException - if the associated task was not executed