public class ACTRRuntime
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOGGER
logger definition
|
Modifier | Constructor and Description |
---|---|
protected |
ACTRRuntime() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IACTRRuntimeListener listener,
java.util.concurrent.Executor executor) |
void |
addModel(IModel model)
add a model to this runtime.
|
void |
dispatch(ACTRRuntimeEvent event) |
java.lang.Object |
getApplicationData() |
IClock |
getClock(IModel model)
return the clock for the model in this runtime.
|
IConnector |
getConnector() |
IController |
getController() |
java.util.Collection<IACTRRuntimeListener> |
getListeners() |
java.util.Collection<IModel> |
getModels()
return all the models associated with the runtime
|
java.lang.Runnable |
getOnStart() |
java.lang.Runnable |
getOnStop()
called by controller
|
static ACTRRuntime |
getRuntime()
return the ACTRRuntime singleton
|
java.io.File |
getWorkingDirectory() |
boolean |
hasListeners() |
void |
removeListener(IACTRRuntimeListener listener) |
void |
removeModel(IModel model)
remove this model, assuming that it is not running.
|
void |
setApplicationData(java.lang.Object applicationData) |
void |
setConnector(IConnector connector) |
void |
setController(IController controller)
will call IController.attach()
|
void |
setOnStart(java.lang.Runnable onStart)
runnable to be executed after the runtime is started by the controller
|
void |
setOnStop(java.lang.Runnable onStop)
runnable to be executed after the runtime has stopped.
|
void |
setWorkingDirectory(java.io.File workingDirectory) |
public static ACTRRuntime getRuntime()
public java.io.File getWorkingDirectory()
public void setWorkingDirectory(java.io.File workingDirectory)
public IConnector getConnector()
public void setConnector(IConnector connector)
public IController getController()
public void setController(IController controller)
controller
- public IClock getClock(IModel model)
model
- if null will always return the default shared clockpublic void addModel(IModel model)
model
- public void removeModel(IModel model)
model
- public java.util.Collection<IModel> getModels()
public void setOnStart(java.lang.Runnable onStart)
onStart
- public java.lang.Runnable getOnStart()
public void setOnStop(java.lang.Runnable onStop)
public java.lang.Runnable getOnStop()
public void setApplicationData(java.lang.Object applicationData)
applicationData
- public java.lang.Object getApplicationData()
public boolean hasListeners()
public java.util.Collection<IACTRRuntimeListener> getListeners()
public void addListener(IACTRRuntimeListener listener, java.util.concurrent.Executor executor)
public void removeListener(IACTRRuntimeListener listener)
public void dispatch(ACTRRuntimeEvent event)