|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IVMController
The IVMController interface allows external components to control the virtual machine through the actual virtual machine controller. The external component can start, pause, resume and stop the virtual machine. Load in a new model and/or concepts. Get access to the event notifier and logger to register for messages.
Field Summary | |
---|---|
static java.lang.String |
APPDIR
The application directory of the virtual machine |
static int |
DISTRIBUTED_MODE
The virtual machine's real-time mode of operation |
static java.lang.String |
MODE_PROPERTY
VM Mode of operation property |
static java.lang.String |
NS_HOST
The property used to retrieve the host name of the name service |
static java.lang.String |
NS_PORT
The property used to retrieve the port number of the name service |
static int |
REALTIME_MODE
The virtual machine's real-time mode of operation |
static int |
SIMULATION_MODE
The virtual machine's simulation mode of operation |
static java.lang.String |
VM_NAME
The property indicating the unique name for the virtual machine/agent environment |
static java.lang.String |
WORKINGDIR
The working directory |
Method Summary | |
---|---|
void |
addProcessListener(IProcessListener listener)
Adds the specified process listener to this virtual machine to be notified when the virtual machine exits. |
gov.nasa.ci.api.asp.IActorServiceProvider |
getASP()
Returns the collaborative infrastructure actor service provider used to make Brahms agents available as CI actors. |
IClock |
getClock()
Returns an interface to the clock maintaining the date and time in a simulation. |
IEventNotifier |
getEventNotifier()
Returns an interface to the event notifier responsible for distributing events from the virtual machine to external components that register with the event notifier for events. |
IExternalService |
getExternalService(java.lang.String id)
Returns the external service with the specified ID if such a service is loaded, otherwise a VMException is thrown. |
ILogger |
getLogger()
Deprecated. Use Log4J's Logger class for logging messages instead |
IModel |
getModel()
Returns an interface to the model loaded in the virtual machine providing access to the concepts loaded in the virtual machine. |
org.omg.CORBA.ORB |
getORB()
Returns, and if necessary creates, the CORBA ORB that can be used to access or use Brahms Corba services. |
java.lang.Object |
getProperty(java.lang.String name)
Returns the property value of the property with the specified name. |
IWorldState |
getWorldState()
Returns the virtual machine's world state managing the fact set. |
void |
loadConcept(java.lang.String sConcept)
Loads the given concept specified by its fully qualified name in the virtual machine. |
void |
loadExternalService(java.lang.String className)
Loads the external service specified with the className in the virtual machine. |
void |
loadModel(java.lang.String sModel)
Loads the given model specified by its fully qualified name in the virtual machine. |
void |
pause()
Pauses all activated concepts, pausing all the engines and the scheduler. |
void |
registerTimeSyncHook(ITimeSyncHook hook)
Register an external time synchronization hook |
void |
removeProcessListener(IProcessListener listener)
Removes the specified listener as a process listener for the virtual machine. |
void |
resume()
Resumes all paused active concepts, resuming the activities of the scheduler and all the engines. |
void |
start()
Activates all the concepts loaded in the virtual machine. |
void |
stop()
Stops the virtual machine and all the concepts. |
Field Detail |
---|
static final java.lang.String APPDIR
static final java.lang.String WORKINGDIR
static final java.lang.String VM_NAME
static final java.lang.String NS_HOST
static final java.lang.String NS_PORT
static final java.lang.String MODE_PROPERTY
static final int SIMULATION_MODE
static final int REALTIME_MODE
static final int DISTRIBUTED_MODE
Method Detail |
---|
void addProcessListener(IProcessListener listener)
listener
- the IProcessListener to be registeredvoid removeProcessListener(IProcessListener listener)
listener
- the IProcessListener to be removed.void loadExternalService(java.lang.String className) throws java.lang.ClassNotFoundException, VMException
Note: Each external service instance must have a unique name. The class needs to ensure this if more then one instance is to be loaded from the same class.
className
- the name of the external service class to be loaded
java.lang.ClassNotFoundException
- if the external service class is not
found
VMException
- if the service could not be loaded due to some
internal error.IExternalService getExternalService(java.lang.String id) throws VMException
id
- the unique id for the requested external service
VMException
- if no service with the specified id is loaded in the vm.void loadModel(java.lang.String sModel) throws ConceptNotFoundException
sModel
- the fully qualified name of the model to be loaded
ConceptNotFoundException
- if the model could not be found
ConceptFormatError
- if the file does not contain well formed
and valid XML based on its DTDvoid loadConcept(java.lang.String sConcept) throws ConceptNotFoundException
sConcept
- the fully qualified name for the concept to be loaded
ConceptNotFoundException
- if the concept could not be found
ConceptFormatError
- if the file does not contain well formed
and valid XML based on its DTD or has invalid references to
Brahms constructsIClock getClock()
IClock
IEventNotifier getEventNotifier()
IEventNotifier
IModel getModel() throws ExternalException
ExternalException
- if an internal error occurs.IWorldState getWorldState() throws ExternalException
ExternalException
- if an internal error occursIWorldState
gov.nasa.ci.api.asp.IActorServiceProvider getASP() throws ExternalException
Note: The virtual machine must be started as a HostingEnvironment
ExternalException
- if there was a problem obtaining the ASPorg.omg.CORBA.ORB getORB() throws ExternalException
ExternalException
- if an error occurs creating or initializing the ORBILogger getLogger()
ILogger
java.lang.Object getProperty(java.lang.String name)
name
- the property name
void start() throws VMException
VMException
- if an error occured in the process of starting the conceptsvoid pause() throws VMException
VMException
- if the virtual machine is in a stopped statevoid resume() throws VMException
VMException
- if the virtual machine is in a stopped statevoid stop() throws VMException
VMException
- if an error occurs in stopping or resetting the virtual machinevoid registerTimeSyncHook(ITimeSyncHook hook)
hook
- the hook object that will synchronize with the external time manager.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |