public interface ExceptionSubscriber
CatchExceptionAttribute
.
The ExceptionSubscriber can then take some action, if desired.
For example, actors that communicate with outside clients may want to pass
along information about the error that has occurred, instead of returning
a generic message or a timeout error response.
This follows the Command design pattern, where the invoker is
CatchExceptionAttribute
, the client is
the Ptolemy developer (defines commands by dragging and dropping
attributes into the model), and the receiver is a Ptolemy entity
(such as an attribute that writes to a file, or an actor such as
HttpActor
which sends a retry
message upon exception with restart policy.CatchExceptionAttribute
Modifier and Type | Method and Description |
---|---|
boolean |
exceptionHandled(boolean successful,
java.lang.String message)
Invoked by an exception handler (e.g.
|
boolean |
exceptionOccurred(java.lang.String policy,
java.lang.Throwable exception)
Action to execute upon the occurrence of an exception.
|
boolean exceptionOccurred(java.lang.String policy, java.lang.Throwable exception)
policy
- The handling policy of the exception manager (for example,
restart); see CatchExceptionAttribute
exception
- The exceptionboolean exceptionHandled(boolean successful, java.lang.String message)
ExceptionManager
) after
an exception has been handled.successful
- True if the exception was successfully handled; false
otherwisemessage
- A status message from the exception handler