scorej.external.jini
Interface MessageQueueInterface

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
MessageQueueImpl, MessageQueueImpl_Stub

public interface MessageQueueInterface
extends java.rmi.Remote

MessageQueueInterface is the remote interface of a Jini node. Methods declared on this define the actions that can be remotely executed on a Jini node. A Scorej implementation of this interface is MessageQueueImpl.


Method Summary
 void changeFilters(java.util.Vector newFilters, Node node)
          Change the filters for the specified node to the new set.
 void deliverMessage(Signal msg)
          Deliver the message to the remote Jini node implementing this interface.
 java.lang.String getCurrentScenario()
          Get the name of the current scenario as a String.
 java.lang.String[] getScenarioNames()
          Gets an array of names of scenarios loaded at the remote node.
 int getStatus()
          Get the current status of the scenario at the remote node.
 double getTime()
          Get the current time at the remote node as a double value.
 void pauseNode()
          Pause the current ScoreJ Scenario at the remote node.
 void registerFilter(Filter filter, Node node)
          Register a filter for the specified node.
 void setCurrentScenario(java.lang.String scenName)
          Sets the current scenario at the remote node.
 void startNode()
          Initialize the current ScoreJ Scenario at the remote node.
 void stopNode()
          Stop the current ScoreJ Scenario at the remote node.
 

Method Detail

deliverMessage

public void deliverMessage(Signal msg)
                    throws java.rmi.RemoteException
Deliver the message to the remote Jini node implementing this interface.

Parameters:
msg - the msg (of type Signal) to be delivered to the remote Jini node.
java.rmi.RemoteException

startNode

public void startNode()
               throws java.lang.Exception
Initialize the current ScoreJ Scenario at the remote node. The MessageQueueImpl implementation of this method also re-initializes the Comm Protocol (in this case Jini).

java.lang.Exception

pauseNode

public void pauseNode()
               throws java.rmi.RemoteException
Pause the current ScoreJ Scenario at the remote node.

java.rmi.RemoteException

stopNode

public void stopNode()
              throws java.rmi.RemoteException
Stop the current ScoreJ Scenario at the remote node. The MessageQueueImpl implementation of this method also stops the Comm Protocol (in this case Jini).

java.rmi.RemoteException

getScenarioNames

public java.lang.String[] getScenarioNames()
                                    throws java.rmi.RemoteException
Gets an array of names of scenarios loaded at the remote node.

Returns:
a String array of scenario names.
java.rmi.RemoteException

setCurrentScenario

public void setCurrentScenario(java.lang.String scenName)
                        throws java.rmi.RemoteException
Sets the current scenario at the remote node. A ScoreJ node can have many scenarios loaded, but only one of them can be set as the current scenario at a time.

Parameters:
scenName - the name of the scenario to be set. This method assumes that a scenario by this name has already been loaded in the remote node.
java.rmi.RemoteException

getCurrentScenario

public java.lang.String getCurrentScenario()
                                    throws java.rmi.RemoteException
Get the name of the current scenario as a String.

java.rmi.RemoteException

getTime

public double getTime()
               throws java.rmi.RemoteException
Get the current time at the remote node as a double value.

java.rmi.RemoteException

getStatus

public int getStatus()
              throws java.rmi.RemoteException
Get the current status of the scenario at the remote node.

Returns:
an integer that can have one of the following values: OmarClock.UNINITIALIZED, OmarClock.INITIALIZED, OmarClock.RUNNING, OmarClock.PAUSED, OmarClock.KILLED.
java.rmi.RemoteException

registerFilter

public void registerFilter(Filter filter,
                           Node node)
                    throws java.rmi.RemoteException
Register a filter for the specified node.

java.rmi.RemoteException

changeFilters

public void changeFilters(java.util.Vector newFilters,
                          Node node)
                   throws java.rmi.RemoteException
Change the filters for the specified node to the new set.

java.rmi.RemoteException