|
|||||||||
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 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 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 | |
---|---|
AgentName |
createAgentIdentity()
Creates a new unique agent identity as required for registering an agent in an agent directory service. |
AgentDirectoryService |
getAgentDirectoryService()
Returns the agent directory service used to register agents and to find agents. |
AgentNamingService |
getAgentNamingService()
Returns the agent naming service used to uniquely name each agent |
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 |
MessageTransportService |
getMessageTransportService()
Returns the message transport service required by agents to communicate with one another. |
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. |
ServiceRoot |
getServiceRoot()
Returns the Service Root providing access to the directory service. |
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 |
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
Method Detail |
---|
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
org.omg.CORBA.ORB getORB() throws ExternalException
ExternalException
- if an error occurs creating or initializing the ORBServiceRoot getServiceRoot() throws ExternalException
ExternalException
- if an internal error occursServiceRoot
AgentNamingService getAgentNamingService() throws ExternalException
ExternalException
- if there's an error retrieving the naming serviceAgentDirectoryService getAgentDirectoryService() throws ExternalException
ExternalException
- if there's an error retrieving the directory serviceMessageTransportService getMessageTransportService() throws ExternalException
ExternalException
- id there's an error retrieving the transport serviceAgentName createAgentIdentity() throws ExternalException
ExternalException
- if an internal error occurs.ILogger 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 machine
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |