public class ExecutionEngine extends java.lang.Object implements ExecutionListener
Modifier and Type | Method and Description |
---|---|
void |
addExecutionListener(ExecutionListener exeListener)
add an execution listener
|
void |
executionError(Manager manager,
java.lang.Throwable throwable)
implements executionError in ExecutionListener
|
void |
executionFinished(Manager manager)
implements executionFinished in ExecutionListener
|
java.util.Vector<ExecutionListener> |
getExecutionListeners()
return a vector of all of the registered ExecutionListeners
|
static ExecutionEngine |
getInstance()
singleton accessor
|
static void |
main(java.lang.String[] args)
command line interface to this class
|
void |
managerStateChanged(Manager manager)
implements managerStateChanged in ExecutionListener
|
static NamedObj |
parseMoML(java.lang.String moml)
static method to parse a moml document and return a NamedObj
|
static NamedObj |
parseMoML(java.lang.String moml,
Workspace workspace)
static method to parse a moml document and return a NamedObj
|
static java.lang.String |
readFile(java.lang.String filename)
read a file and return its contents as a string
|
void |
removeExecutionListener(ExecutionListener exeListener)
remove an execution listener
|
Manager |
runModel(CompositeActor model)
run a single model in the current thread
|
Manager |
runModelInThread(CompositeActor model)
run a model in a new thread.
|
public static ExecutionEngine getInstance()
public Manager runModel(CompositeActor model) throws IllegalActionException, KernelException
model
- the model to runIllegalActionException
KernelException
public Manager runModelInThread(CompositeActor model) throws IllegalActionException, KernelException
model
- the model to runIllegalActionException
KernelException
public void addExecutionListener(ExecutionListener exeListener)
exeListener
- the listener to addpublic void removeExecutionListener(ExecutionListener exeListener)
exeListener
- the listener to removepublic java.util.Vector<ExecutionListener> getExecutionListeners()
public static NamedObj parseMoML(java.lang.String moml) throws java.lang.Exception
moml
- the moml to parsejava.lang.Exception
public static NamedObj parseMoML(java.lang.String moml, Workspace workspace) throws java.lang.Exception
moml
- the moml to parseworkspace
- the workspace to parse the moml in to.java.lang.Exception
public static java.lang.String readFile(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
filename
- the name or path of the file to readjava.io.FileNotFoundException
java.io.IOException
public static void main(java.lang.String[] args)
public void executionError(Manager manager, java.lang.Throwable throwable)
executionError
in interface ExecutionListener
manager
- The manager controlling the execution.throwable
- The throwable to report.public void executionFinished(Manager manager)
executionFinished
in interface ExecutionListener
manager
- The manager controlling the execution.public void managerStateChanged(Manager manager)
managerStateChanged
in interface ExecutionListener
manager
- The manager controlling the execution.Manager.getState()