api
Interface Computer2Server

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
Server

public interface Computer2Server
extends java.rmi.Remote

The computer's view of the server. Specifies methods for a computer to submit results and request tasks.


Field Summary
static java.lang.String NAME
          The RMI registry name for the compute server.
 
Method Summary
 LoginContainer login(Server2Computer computer)
          Logs a computer in to a server.
 void putResult(Server2Computer computer, Result result)
          puts a result on the server
 Task takeTask(Server2Computer computer)
          Blocking call to take a task from the server
 Task[] takeTasks(Server2Computer computer, int count)
          Non-blocking request for multiple tasks
 void updateShared(Server2Computer computer, Shared shared)
          send a shared update to the server
 

Field Detail

NAME

static final java.lang.String NAME
The RMI registry name for the compute server.

See Also:
Constant Field Values
Method Detail

login

LoginContainer login(Server2Computer computer)
                     throws java.rmi.RemoteException
Logs a computer in to a server.

Parameters:
computer - A reference to the remote computer object that is logging in. This allows the server to make calls to the computer.
Returns:
a container with some initial values for the compuer
Throws:
java.rmi.RemoteException - RMI Exception

takeTask

Task takeTask(Server2Computer computer)
              throws java.rmi.RemoteException
Blocking call to take a task from the server

Parameters:
computer - the computer requesting the task
Returns:
a new task for the computer to execute
Throws:
java.rmi.RemoteException - RMI Exception

takeTasks

Task[] takeTasks(Server2Computer computer,
                 int count)
                 throws java.rmi.RemoteException
Non-blocking request for multiple tasks

Parameters:
computer - The requesting computer
count - The number of desired tasks
Returns:
an array of tasks of some length between 0 and count
Throws:
java.rmi.RemoteException - RMI Exception

putResult

void putResult(Server2Computer computer,
               Result result)
               throws java.rmi.RemoteException
puts a result on the server

Parameters:
computer - the computer issuing the result
result - the result object
Throws:
java.rmi.RemoteException - RMI Exception

updateShared

void updateShared(Server2Computer computer,
                  Shared shared)
                  throws java.rmi.RemoteException
send a shared update to the server

Parameters:
computer - the computer issuing the update
shared - the new shared object
Throws:
java.rmi.RemoteException - RMI Exception