gsim.core.runtime
Interface ScenarioConnector


public interface ScenarioConnector

A ScenarioConnector is similar to a SimulatioManager, but it can connect to the simulation instance without knowing the reference. In a distributed environment, this usually happens via JMS communication.

Author:
Stephan

Method Summary
 void clearListeners()
          Removes all listeners.
 void disconnect()
          Disconnects from the simulation engine.
 SimulationID[] getInstances()
          Gets the simulation ids of the simulations instances currently running for the model.
 ModelState getModelState(SimulationID uid)
          Returns the current state of a simulation.
 long getTime(SimulationID id)
          Gets the current time step of a simulation.
 void pause()
          Pauses the model run by pausing all simulation instances.
 void registerSimulationListener(ScenarioListener listener)
          Registers a listener.
 void resume()
          Resumes a model run by resuming all simulation instances.
 void shutdown()
          Shuts down a model run and all its simulations.
 void unregisterSimulationListener(ScenarioListener listener)
          Removes a single listener.
 

Method Detail

disconnect

void disconnect()
                throws GSimException
Disconnects from the simulation engine.

Throws:
GSimException

getTime

long getTime(SimulationID id)
             throws GSimException
Gets the current time step of a simulation.

Parameters:
id - simulation id
Returns:
long the step
Throws:
GSimException

clearListeners

void clearListeners()
                    throws GSimException
Removes all listeners.

Throws:
GSimException

getInstances

SimulationID[] getInstances()
                            throws GSimException
Gets the simulation ids of the simulations instances currently running for the model.

Returns:
List of SimulationID
Throws:
GSimException

getModelState

ModelState getModelState(SimulationID uid)
                         throws GSimException
Returns the current state of a simulation.

Parameters:
uid - id of the simulation
Returns:
ModelState an object containing information about the current state of the model
Throws:
GSimException

pause

void pause()
           throws GSimException
Pauses the model run by pausing all simulation instances.

Throws:
GSimException

registerSimulationListener

void registerSimulationListener(ScenarioListener listener)
                                throws GSimException
Registers a listener. The ScenarioManager informs listeners about events such as the end of a simulation.

Parameters:
listener - the listener
Throws:
GSimException

resume

void resume()
            throws GSimException
Resumes a model run by resuming all simulation instances.

Throws:
GSimException

shutdown

void shutdown()
              throws GSimException
Shuts down a model run and all its simulations.

Throws:
GSimException

unregisterSimulationListener

void unregisterSimulationListener(ScenarioListener listener)
                                  throws GSimException
Removes a single listener.

Parameters:
listener - the listener
Throws:
GSimException