com.goldenhammer.node
Class SimulationNode

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bycom.goldenhammer.node.SimulationNode
All Implemented Interfaces:
Node, java.rmi.Remote, java.io.Serializable

public class SimulationNode
extends java.rmi.server.UnicastRemoteObject
implements Node

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
SimulationNode()
          default constructor
 
Method Summary
 void addModality(Modality modality)
           
 void endSimulation()
          This method is similar to a finalize in taht it will do whatever is necissary to 'clean up' after the simulation.
 java.util.Collection getStatus()
          Gets from the node an ArrayList of ModalityStatus objects that contain information about the current status of each modality on this node
 ModalityStatsSummary getSummaryForNode(java.lang.String testID)
           
 java.lang.String getTestID()
           
static void main(java.lang.String[] args)
          main method
 void markCompleted(SimulationThread thread)
          notify the node that the modality is finished
 void nuke()
           
 void startSimulation(java.lang.String testID)
          starts the simulation.
 void stopSimulation()
          stops this node (kills every modality thread)
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimulationNode

public SimulationNode()
               throws java.rmi.RemoteException
default constructor

Throws:
java.rmi.RemoteException
Method Detail

startSimulation

public void startSimulation(java.lang.String testID)
                     throws java.rmi.RemoteException
Description copied from interface: Node
starts the simulation. this is called by the controller machine. Before this method is called the node should have created at least one modality for it to run

Specified by:
startSimulation in interface Node
Parameters:
testID -
Throws:
java.rmi.RemoteException

endSimulation

public void endSimulation()
Description copied from interface: Node
This method is similar to a finalize in taht it will do whatever is necissary to 'clean up' after the simulation. It is called by the controller AFTER the controller has determined all modalities/nodes haves completed. **NOTE** this is different than stopSimulation which stops execution

Specified by:
endSimulation in interface Node

markCompleted

public void markCompleted(SimulationThread thread)
                   throws java.rmi.RemoteException
Description copied from interface: Node
notify the node that the modality is finished

Specified by:
markCompleted in interface Node
Parameters:
thread -
Throws:
java.rmi.RemoteException

stopSimulation

public void stopSimulation()
                    throws java.rmi.RemoteException
Description copied from interface: Node
stops this node (kills every modality thread)

Specified by:
stopSimulation in interface Node
Throws:
java.rmi.RemoteException

addModality

public void addModality(Modality modality)
                 throws java.rmi.RemoteException
Specified by:
addModality in interface Node
Parameters:
modality -
Throws:
java.rmi.RemoteException

getStatus

public java.util.Collection getStatus()
                               throws java.rmi.RemoteException
Gets from the node an ArrayList of ModalityStatus objects that contain information about the current status of each modality on this node

Specified by:
getStatus in interface Node
Returns:
An ArrayList of ModalityStatus objects
Throws:
java.rmi.RemoteException

main

public static void main(java.lang.String[] args)
main method

Parameters:
args -

nuke

public void nuke()
          throws java.rmi.RemoteException
Specified by:
nuke in interface Node
Throws:
java.rmi.RemoteException

getTestID

public java.lang.String getTestID()
                           throws java.rmi.RemoteException
Specified by:
getTestID in interface Node
Returns:
Throws:
java.rmi.RemoteException

getSummaryForNode

public ModalityStatsSummary getSummaryForNode(java.lang.String testID)
                                       throws java.rmi.RemoteException
Specified by:
getSummaryForNode in interface Node
Parameters:
testID -
Returns:
Throws:
java.rmi.RemoteException