Class RoleViolationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.terracottatech.store.coordination.RoleViolationException
- All Implemented Interfaces:
Serializable
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 throwIllegalStateException
. - terminated normally then the
getResult()
method will return the result of the task. - terminated exceptionally then the
getResult()
method will throw anExecutionException
wrapping the original failure. The same exception will also be attached as a suppressed exception of thisRoleViolationException
.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<R> R
Return the result of the associated role task execution.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
getResult
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 failedIllegalStateException
- if the associated task was not executed
-