Package ptolemy.component
Interface Component
-
- All Known Implementing Classes:
AtomicComponent
,ComponentActor
,ComponentDirector
,Counter
,Leds
,PtinyOSDirector
public interface Component
This interface defines the basic methods for initializing and executing components. The intended usage is that preinitialize() is invoked exactly once in an execution of a model, before any static analysis such as scheduling or type resolution is done. The initialize() method may be invoked more than once to initialize() a component, and it is invoked after static analysis. The run() method may be invoked multiple times after initialize(). The wrapup() method is invoked exactly once at the end of an execution of a model. It is important that an implementor ensure that wrapup() is called even if an exception occurs.- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Yang Zhao and Edward A. Lee
- Pt.AcceptedRating:
- red (davisj)
- Pt.ProposedRating:
- yellow (ellen_zh)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
initialize()
Initialize the component.void
preinitialize()
Preinitialize the component.void
run()
Execute the component.void
wrapup()
Wrap up an execution.
-
-
-
Method Detail
-
initialize
void initialize() throws IllegalActionException
Initialize the component. This is invoked once after preinitialize() and again whenever the component needs to be reinitialized.- Throws:
IllegalActionException
- If initialization cannot be completed.
-
preinitialize
void preinitialize() throws IllegalActionException
Preinitialize the component. This is invoked exactly once per execution of a model, before any other methods in this interface are invoked.- Throws:
IllegalActionException
- If preinitialization cannot be completed.
-
run
void run() throws IllegalActionException
Execute the component. This is invoked after preinitialize() and initialize(), and may be invoked repeatedly.- Throws:
IllegalActionException
- If the run cannot be completed.
-
wrapup
void wrapup() throws IllegalActionException
Wrap up an execution. This method is invoked exactly once per execution of a model. It finalizes an execution, typically closing files, displaying final results, etc. If any other method from this interface is invoked after this, it must begin with preinitialize().- Throws:
IllegalActionException
- If wrapup fails.
-
-