distrit
Interface InteractiveTaskServer

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
MultiServerDaemon, SingleServerWrapper, TestITS

public interface InteractiveTaskServer
extends java.rmi.Remote

Remote interface for clients to connect to a server managing interactive tasks. The server and clients work as follows:

  1. Client gets handle of server through RMI and calls the getID method. From then on this client will always use this ID when communicating to the server.
  2. Client will ask for the task and then start running it.
  3. Client will regularly call the interact method to exchange I/O with the server.

The reason this is not in the server package is that it is not a server side only object. Ie the client must know about it.


Method Summary
 java.lang.Object getID(java.lang.Object initialParameters)
          Called by clients the first time they connect.
 InteractiveTask getTask(java.lang.Object id)
          This will provide the client with the InteractiveTask it should run.
 java.lang.Object interact(java.lang.Object id, java.lang.Object clientTaskOutput)
          Called by clients when they wish to interact.
 

Method Detail

getID

public java.lang.Object getID(java.lang.Object initialParameters)
                       throws java.rmi.RemoteException
Called by clients the first time they connect.
Parameters:
initialParameters - Initial parameters from client local configuration. The current client implementation, see InteractiveTaskClient, provides the ip address of the client and the command line paramaters used to launch the client. These are packaged in a Vector.
Returns:
The ID of this client will from now on used for interaction with the server.

getTask

public InteractiveTask getTask(java.lang.Object id)
                        throws java.rmi.RemoteException
This will provide the client with the InteractiveTask it should run.
Parameters:
id - The ID provided by the getID method by which the client will always refer to itself.
Returns:
The task this client should run. This could be exactly the same as the one all other clients are running or tailored to this particular client.

interact

public java.lang.Object interact(java.lang.Object id,
                                 java.lang.Object clientTaskOutput)
                          throws java.rmi.RemoteException
Called by clients when they wish to interact.
Parameters:
id - the client's ID
clientTaskOutput - the outputs of the client obtained by task.get( null ) on the client task
Returns:
whatever should be sent into the client through task.set( )