public class ExceptionManager extends MoMLModelAttribute implements ExceptionHandler, ExecutionListener, Initializable, HierarchyListener
| Red (beth) |
| Red (beth) |
NamedObj.ContainedObjectsIterator| Modifier and Type | Field and Description |
|---|---|
StringParameter |
exceptionMessage
The exception message from the caught exception.
|
StringParameter |
policy
The error handling policy to apply if an exception occurs.
|
StringParameter |
statusMessage
The latest action, if any, taken by the CatchExceptionAttribute.
|
_model, modelURL_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS| Constructor and Description |
|---|
ExceptionManager(NamedObj container,
java.lang.String name)
Create a model attribute with the specified container and name.
|
| Modifier and Type | Method and Description |
|---|---|
protected Initializable |
_getInitializableContainer()
Return the first Initializable encountered above this
in the hierarchy that will be initialized (i.e., it is either
an atomic actor or an opaque composite actor).
|
void |
addInitializable(Initializable initializable)
Add the specified object to the set of objects whose
preinitialize(), initialize(), and wrapup()
methods should be invoked upon invocation of the corresponding
methods of this object.
|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace.
|
void |
executionError(Manager manager,
java.lang.Throwable throwable)
Do nothing upon execution error.
|
void |
executionFinished(Manager manager)
Restart here if restart is desired.
|
boolean |
handleException(NamedObj context,
java.lang.Throwable exception)
Handle an exception according to the specified policy:
continue: Not implemented yet
Consume the exception and return control to the director.
|
void |
hierarchyChanged()
Notify this object that the containment hierarchy above it has
changed.
|
void |
hierarchyWillChange()
Notify this object that the containment hierarchy above it will be
changed.
|
void |
initialize()
Find all of the ExceptionSubscribers in the model and save in a list.
|
void |
managerStateChanged(Manager manager)
React to a change of state in the Manager.
|
void |
preinitialize()
Register this attribute with the manager.
|
void |
removeInitializable(Initializable initializable)
Remove the specified object from the list of objects whose
preinitialize(), initialize(), and wrapup()
methods should be invoked upon invocation of the corresponding
methods of this object.
|
void |
setContainer(NamedObj container)
Override the base class to register as an
Initializable
so that preinitialize() is invoked, and as a
HierarchyListener, so that we are notified of
changes in the hierarchy above. |
void |
wrapup()
Invoke wrapup() on registered initializables.
|
_exportMoMLContents, attributeChanged, configure, getConfigureSource, getConfigureText, getContainedModel_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescription, getContainer, getDisplayName, getFullName, getName, getName, setNamepublic StringParameter exceptionMessage
public StringParameter policy
CatchExceptionAttributepublic StringParameter statusMessage
public ExceptionManager(NamedObj container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container - The specified container.name - The specified name.IllegalActionException - If the attribute is not of an
acceptable class for the container, or if the name contains a period.NameDuplicationException - If the name coincides with an
attribute already in the container.public void addInitializable(Initializable initializable)
addInitializable in interface Initializableinitializable - The object whose methods should be invoked.removeInitializable(Initializable)public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone in class MoMLModelAttributeworkspace - The workspace for the new object.java.lang.CloneNotSupportedException - If any of the attributes
cannot be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)public void executionError(Manager manager, java.lang.Throwable throwable)
executionError in interface ExecutionListenermanager - The manager controlling the execution.throwable - The throwable to report.public void executionFinished(Manager manager)
executionFinished in interface ExecutionListenermanager - The manager controlling the execution.public void hierarchyChanged()
throws IllegalActionException
preinitialize() to handle re-establishing the connections.hierarchyChanged in interface HierarchyListenerIllegalActionException - If the change is not
acceptable.AbstractInitializableAttributepublic void hierarchyWillChange()
throws IllegalActionException
hierarchyWillChange in interface HierarchyListenerIllegalActionException - If unlinking to a published port fails.AbstractInitializableAttributepublic void initialize()
throws IllegalActionException
initialize in interface InitializableIllegalActionException - If thrown by parentpublic boolean handleException(NamedObj context, java.lang.Throwable exception) throws IllegalActionException
handleException in interface ExceptionHandlercontext - The object in which the error occurred.exception - The exception to be handled.IllegalActionException - If thrown by the parentpublic void managerStateChanged(Manager manager)
managerStateChanged in interface ExecutionListenermanager - The model managerManager.getState()public void removeInitializable(Initializable initializable)
removeInitializable in interface Initializableinitializable - The object whose methods should no longer be invoked.addInitializable(Initializable)public void preinitialize()
throws IllegalActionException
preinitialize in interface InitializableIllegalActionException - If the parent class throws itpublic void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
Initializable
so that preinitialize() is invoked, and as a
HierarchyListener, so that we are notified of
changes in the hierarchy above.setContainer in class Attributecontainer - The proposed container.IllegalActionException - If the action would result in a
recursive containment structure, or if
this entity and container are not in the same workspace.NameDuplicationException - If the container already has
an entity with the name of this entity.AbstractInitializableAttributepublic void wrapup()
throws IllegalActionException
wrapup in interface InitializableIllegalActionException - If thrown by a subclass.AbstractInitializableAttributeprotected Initializable _getInitializableContainer()
AbstractInitializableAttribute