ptolemy.actor
Interface ExecutionListener

All Known Implementing Classes:
ActorEditorGraphController, ActorViewerGraphController, ApplyFilterOverArray, CaseGraphFrame.CaseGraphController, CaseGraphFrame.CaseGraphController, ConfigurationApplication, FmvAutomatonGraphController, FmvAutomatonGraphController, FSMGraphController, FSMGraphController, FSMViewerGraphController, FSMViewerGraphController, InterfaceAutomatonGraphController, InterfaceAutomatonGraphController, MatchResultViewer.MatchResultActorGraphController, MatchResultViewer.MatchResultFSMGraphController, ModelFrame, ModelReference, MoMLApplet, MoMLApplication, MoMLCommandLineApplication, MoMLSimpleApplication, MoMLSimpleApplication, MoMLSimpleStatisticalApplication, MoMLViewerApplet, PteraGraphController, PtExecuteApplication, PtolemyApplet, PtolemyApplication, RunnableGraphController, RunTableau.RunFrame, SingleWindowApplication, StreamExecutionListener, TransformationAttribute.TransformationListener, TransformationAttributeController.Listener, TransformationAttributeEditorFactory.TransformationListener, TransformationEditor.TransformationActorGraphController, TransformationEditor.TransformationFSMGraphController, TypeAnimatorApplet, VergilApplication, VisualModelReference

public interface ExecutionListener

An ExecutionListener listens for events that are issued during the execution of a model by a Manager. In general, an object that implements this interface will probably be a front end such as an applet, a GUI, or a command-line interpreter, or an object that is communicating with a front end. Most of the events that are reported are state changes in the manager.

Some execution events happen in response to an asynchronous request. For example, when the pause() method of a manager is called, a flag is set, and at the end of the next toplevel iteration, the manager will notice the flag and pause execution. In such cases, the execution listeners are not notified when the request occurs, but only when the execution thread has actually been suspended.

Since:
Ptolemy II 0.2
Version:
$Id: ExecutionListener.java 38797 2005-07-08 19:39:38Z cxh $
Author:
Steve Neuendorffer, Edward A. Lee
See Also:
Manager
Accepted Rating:
Green (bart)
Proposed Rating:
Green (neuendor)

Method Summary
 void executionError(Manager manager, java.lang.Throwable throwable)
          Report an execution failure.
 void executionFinished(Manager manager)
          Report that the current execution has finished and the wrapup sequence has completed normally.
 void managerStateChanged(Manager manager)
          Report that the manager has changed state.
 

Method Detail

executionError

void executionError(Manager manager,
                    java.lang.Throwable throwable)
Report an execution failure. This method will be called when an exception or error is caught by a manager. Exceptions are reported this way when the run() or startRun() methods of the manager are used to perform the execution. If instead the execute() method is used, then exceptions are not caught, and are instead just passed up to the caller of the execute() method. Those exceptions are not reported here (unless, of course, the caller of the execute() method does so).

Parameters:
manager - The manager controlling the execution.
throwable - The throwable to report.

executionFinished

void executionFinished(Manager manager)
Report that the current execution has finished and the wrapup sequence has completed normally. The number of successfully completed iterations can be obtained by calling getIterationCount() on the manager.

Parameters:
manager - The manager controlling the execution.

managerStateChanged

void managerStateChanged(Manager manager)
Report that the manager has changed state. To access the new state, use the getState() method of Manager.

Parameters:
manager - The manager controlling the execution.
See Also:
Manager.getState()