public class CatchExceptionAttribute extends AbstractInitializableAttribute implements ExceptionHandler, ExecutionListener
Red (beth) |
Red (beth) |
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTINUE
String value for the "continue" policy.
|
StringParameter |
exceptionMessage
The exception message from the caught exception.
|
FileParameter |
logFileName
The file, if any, to log messages to.
|
StringParameter |
policy
The error handling policy to apply if an exception occurs.
|
static java.lang.String |
RESTART
String value for the "restart" policy.
|
StringParameter |
statusMessage
The latest action, if any, taken by the CatchExceptionAttribute.
|
static java.lang.String |
STOP
String value for the "stop" policy.
|
static java.lang.String |
THROW
String value for the "throw" policy.
|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
CatchExceptionAttribute(CompositeEntity container,
java.lang.String name)
Create a new actor in the specified container with the specified
name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_writeMessage(java.lang.String message)
Write the given message to the statusMessage parameter and to the log
file, if open.
|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute.
|
java.lang.Object |
clone(Workspace workspace)
Clone the attribute 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 |
initialize()
Find all of the ExceptionSubscribers in the model.
|
void |
managerStateChanged(Manager manager)
React to a change of state in the Manager.
|
void |
preinitialize()
Register this attribute with the manager.
|
_getInitializableContainer, addInitializable, hierarchyChanged, hierarchyWillChange, removeInitializable, setContainer, wrapup
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _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, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
description, getContainer, getDisplayName, getFullName, getName, getName, setName
public StringParameter exceptionMessage
public FileParameter logFileName
public StringParameter policy
public StringParameter statusMessage
public static final java.lang.String CONTINUE
public static final java.lang.String RESTART
public static final java.lang.String THROW
public static final java.lang.String STOP
public CatchExceptionAttribute(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor within the container.IllegalActionException
- If this actor cannot be contained
by the proposed container (see the setContainer() method).NameDuplicationException
- If the name coincides with
an entity already in the container.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.IllegalActionException
- If the change is not acceptable
to this container (not thrown in this base class).public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class AbstractInitializableAttribute
workspace
- The workspace for the new object.java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.Object.clone()
public void executionError(Manager manager, java.lang.Throwable throwable)
executionError
in interface ExecutionListener
manager
- Ignored.throwable
- Ignored.public void executionFinished(Manager manager)
executionFinished
in interface ExecutionListener
manager
- The manager that starts the run.public boolean handleException(NamedObj context, java.lang.Throwable exception) throws IllegalActionException
handleException
in interface ExceptionHandler
context
- The object in which the error occurred.exception
- The exception to be handled.IllegalActionException
- If thrown by the parentpublic void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AbstractInitializableAttribute
IllegalActionException
- If thrown by parentpublic void managerStateChanged(Manager manager)
managerStateChanged
in interface ExecutionListener
manager
- The model managerManager.getState()
public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class AbstractInitializableAttribute
IllegalActionException
- If the parent class throws itprotected void _writeMessage(java.lang.String message) throws java.io.IOException
message
- The message to writejava.io.IOException
- If there is a problem writing to the file