|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.ogf.saga.error.SagaException
public abstract class SagaException
This is the base class for all exceptions in SAGA. It is a checked exception,
so all exceptions in SAGA are checked exceptions.
The Throwable.getMessage() method does not quite behave as specified in the SAGA specs,
because Java already has toString() for exactly that behavior.
So, Throwable.getMessage() does what it always does for Java throwables.
A simple mechanism exists for storing and examining exceptions that may be thrown
by adaptors in adaptor-based Saga implementations. In such implementations, the
top-level exception (the one highest up in the Saga exception hierarchy) is not
always the most informative one, and the implementation is not always capable
of selecting the most informative exception. In these cases, the implementation
may opt to add the individual exceptions as nested exceptions to the exception
thrown. The nested exceptions can be examined using the getAllExceptions()
or getAllMessages() methods.
In addition to the getAllExceptions() and getAllMessages() mechanisms,
this implementation also allows the user to iterate over the lower-level exception
list.
| Method Summary | |
|---|---|
void |
addNestedException(SagaException e)
Adds an exception to the list of nested exceptions. |
int |
compareTo(SagaException o)
Gives preference to the most specific exception. |
List<SagaException> |
getAllExceptions()
Gets the list of lower-level exceptions. |
List<String> |
getAllMessages()
Gets the list of lower-level exception messages. |
SagaObject |
getObject()
Returns the SAGA object associated with this exception. |
Iterator<SagaException> |
iterator()
Returns an iterator that iterates over the nested exceptions. |
String |
toString()
Returns a short description of this SagaException. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public SagaObject getObject()
throws DoesNotExistException,
NoSuccessException
DoesNotExistException - is thrown when there is no object associated with this exception.
NoSuccessException - is thrown when the operation was not successfully performed,
and none of the other exceptions apply.public int compareTo(SagaException o)
compareTo in interface Comparable<SagaException>public String toString()
SagaException.
If this SagaException object was created with a non-null detail message string,
then the result is the concatenation of three strings:
Throwable.getMessage() method for this object
SagaException object was created with a null detail message string,
then only the simple (unqualified) name of the actual class of this object is returned.
toString in class ThrowableSagaException.public void addNestedException(SagaException e)
e - the exception to be added to the list.public Iterator<SagaException> iterator()
iterator in interface Iterable<SagaException>public List<SagaException> getAllExceptions()
public List<String> getAllMessages()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||