gov.nist.antd.ssf.event.script
Class EventManager

java.lang.Object
  |
  +--com.renesys.raceway.SSF.Entity
        |
        +--SSF.OS.ProtocolGraph
              |
              +--SSF.Net.Host
                    |
                    +--gov.nist.antd.ssf.event.script.EventManager
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable

public class EventManager
extends Host

This class implements an event manager to be able to script event from the DML file.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil

Field Summary
 long CallbackTime
          The delay between to calls to the timer (in TICs)
private  java.util.Vector events
          The vector of ScriptEvent
private  int sleepTime
          The time for the timer to sleep
private  boolean started
          Indicates if the simulation is started.
private  boolean stopSim
          Inidicates if the simulation must be stopped
static int STOPTIME
          The time when the simulation must stop
private  Timer timer
          The timer that controls the simulation speed
 
Fields inherited from class SSF.Net.Host
hostConfig, ID, interfaceAddresses, interfaceNumbers, net, nhi, nhi_context
 
Fields inherited from class SSF.OS.ProtocolGraph
description
 
Fields inherited from class com.renesys.raceway.SSF.Entity
 
Constructor Summary
EventManager(Net net, java.lang.String nhi, int id)
          Constructor of an OXC.
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure the events from de DML file
protected  void configEvent(com.renesys.raceway.DML.Configuration cfg)
          Configure an event by creating an instance of the class
 java.util.Vector getEvents()
          Return a copy of the events.
 void init()
          Initialise all the events
 void removeEvent(ScriptEvent event)
          Delete the given event by using the cancel method of the event
 void resumeTimer()
          Resume the simulation
 void setSimSpeed(int spd)
          Control the speed of the simulation
 void stopTimer()
          Stop the timer
 
Methods inherited from class SSF.Net.Host
defined_in_network, getNet, global_nhi_to_ip, local_nhi_to_ip, toString
 
Methods inherited from class SSF.OS.ProtocolGraph
cpu, SessionForName
 
Methods inherited from class com.renesys.raceway.SSF.Entity
alignment, alignTo, coalignedEntities, inChannels, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, resumeAll, startAll, startAll, startClient, startClient, startServer, W, Z
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

events

private java.util.Vector events
The vector of ScriptEvent


started

private boolean started
Indicates if the simulation is started.


timer

private Timer timer
The timer that controls the simulation speed


sleepTime

private int sleepTime
The time for the timer to sleep


stopSim

private boolean stopSim
Inidicates if the simulation must be stopped


CallbackTime

public long CallbackTime
The delay between to calls to the timer (in TICs)


STOPTIME

public static final int STOPTIME
The time when the simulation must stop

See Also:
Constant Field Values
Constructor Detail

EventManager

public EventManager(Net net,
                    java.lang.String nhi,
                    int id)
Constructor of an OXC.

Parameters:
net - network within which the OXC is to be configured.
nhi - NHI address of the containing network.
id - integer OXC ID.
Method Detail

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configure the events from de DML file

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class Host
Parameters:
cfg - The DML configuration
Throws:
com.renesys.raceway.DML.configException - if a configuration error occurs

configEvent

protected void configEvent(com.renesys.raceway.DML.Configuration cfg)
                    throws com.renesys.raceway.DML.configException
Configure an event by creating an instance of the class

Parameters:
cfg - The configuration of the event
Throws:
com.renesys.raceway.DML.configException - if a configuration error occurs

init

public void init()
Initialise all the events

Overrides:
init in class Host

getEvents

public java.util.Vector getEvents()
Return a copy of the events.

Returns:
A copy of the internal event vector.

removeEvent

public void removeEvent(ScriptEvent event)
Delete the given event by using the cancel method of the event

Parameters:
event - The ScriptEvent to remove

setSimSpeed

public void setSimSpeed(int spd)
Control the speed of the simulation

Parameters:
spd - The speed of the timer (in %)

stopTimer

public void stopTimer()
Stop the timer


resumeTimer

public void resumeTimer()
Resume the simulation