package jicos.system;
import java.rmi.Remote;
import java.rmi.RemoteException;
/** Allows ProductionNetwork
, Producer
, and Task
to interact with TaskServer.
*/
public interface TaskServer extends Remote
{
/** Service name used in rmiregistry.
*/
public static String NAME = "TaskServer";
/** Not part of API.
* @throws RemoteException This is a remote method.
* @return ConsumerInfo - Please see {@link ConsumerInfo}.
*/
public SessionInfo getState() throws RemoteException;
/** Producer gets a Task.
* @return A Task object.
* @param taskInfo The TaskId
of the Task
that was just completed by the Producer
. A null
value is used to convey that this is the 1st getTask
request by this Producer
: There is no Task
that was just completed.
* @throws RemoteException It is a Remote
method.
*/
//public /*Task*/ void getTask ( TaskInfo taskInfo, Bag outbox ) throws RemoteException;
public Task[] getTasks() throws RemoteException;
public void registerChild( int child, TaskServer childServer )
throws RemoteException;
/** Not part of API.
*
* (ProductionNetwork
registers a new Consumer
as the
* current owner of the ProductionNetwork
;
* reset state for new computation.)
* @param consumerInfo Container of consumer information. Please see {@link ConsumerInfo}.
* @throws RemoteException This is a Remote method.
*/
public void registerClient ( SessionInfo sessionInfo )
throws RemoteException;
/** Not part of API.
*
* (Register Producer.)
* @param p Remote reference to the producer.
* @param i The container of information associated with a producer that is maintained by
* the TaskServer.
* @throws RemoteException This is a Remote method.
* @return A container of consumer information. Please see {@link ConsumerInfo}.
*/
public SessionInfo registerProducer ( Cell h, HostInfo i ) throws RemoteException;
/** Set a value, v, for the ith argument of successor task t:
* Pseudo-code: t.inputs[i] = v;
* @param taskId of the task whose input is to be set.
* @param index of inputs of the task whose input is to be set.
* @param v is the argument value.
* @throws RemoteException This is a Remote method.
*/
public void setArg ( TaskId taskId, int index, Object v ) throws RemoteException;
/** Not part of API.
* @param initiator refers to the neighboring TaskServer that is proposing the new value for the Shared object.
* @param shared The proposed new value.
* @throws RemoteException This is a Remote method.
*/
public void setShared ( Shared shared, int initiator ) throws RemoteException;
/** Not part of the API.
*
* (Unregister owner of ProductionNetwork with TaskServer;
* reset state for new computation.)
* @throws RemoteException This is a Remote method.
* @return ConsumerStatistics contains quantities of ProductionNetwork resources consumed.
*/
//public SessionStatistics unregisterClient () throws RemoteException;
/** Not part of API.
*
* (Unregister Host. Will not be used remotely until screensaver/daemon
* incorporates it.)
* @param p Remote reference to the Host that is unregistering.
* @throws RemoteException This is a Remote method.
*/
public void unregisterProducer ( Cell h ) throws RemoteException;
}