cs290b.project.api
Interface Client2Server

All Superinterfaces:
Administrable, java.rmi.Remote
All Known Implementing Classes:
ServerImpl

public interface Client2Server
extends Administrable

Server interface exposed to the client.


Field Summary
static java.lang.String ServiceName
          Used by the client to identify the remote server in the registry.
 
Method Summary
 long getAvgRunTime()
          The average run time for each task.
 int getTaskCount()
          Return the number of tasks created.
 long getTotalRunTime()
          Return the amount of time it took for the tasks to run.
 void registerListener(RemoteListener listener)
          Used to register a remote listener on a server or computer.
 TaskId runTask(RunTimeListener listener, Task task)
          Used to place a task on the server for execution.
 void setComputation(java.lang.Object input)
          Sets the common input for all the tasks.
 void setShared(Shared shared)
          Sets the shared object.
 Result takeResult()
          Return a result that has been processed.
 
Methods inherited from interface cs290b.project.api.Administrable
exitService, stopService
 

Field Detail

ServiceName

static final java.lang.String ServiceName
Used by the client to identify the remote server in the registry.

See Also:
Constant Field Values
Method Detail

registerListener

void registerListener(RemoteListener listener)
                      throws java.rmi.RemoteException
Used to register a remote listener on a server or computer.

Parameters:
listener - The listener to register.
Throws:
java.rmi.RemoteException

setComputation

void setComputation(java.lang.Object input)
                    throws java.rmi.RemoteException
Sets the common input for all the tasks.

Parameters:
input - The input to be dispersed to all the computers.
Throws:
java.rmi.RemoteException

setShared

void setShared(Shared shared)
               throws java.rmi.RemoteException
Sets the shared object.

Parameters:
shared - The shared to be dispersed to all the computers.
Throws:
java.rmi.RemoteException

runTask

TaskId runTask(RunTimeListener listener,
               Task task)
               throws java.rmi.RemoteException
Used to place a task on the server for execution.

Parameters:
task - The divide and conquer task to execute.
Returns:
The assigned task id.
Throws:
java.rmi.RemoteException

takeResult

Result takeResult()
                  throws java.rmi.RemoteException
Return a result that has been processed. Intermediate results are returned.

Returns:
A partial result. The answer will have the TaskId from the putTask method.
Throws:
java.rmi.RemoteException

getTaskCount

int getTaskCount()
                 throws java.rmi.RemoteException
Return the number of tasks created.

Returns:
The number of tasks created during the last execution.
Throws:
java.rmi.RemoteException

getTotalRunTime

long getTotalRunTime()
                     throws java.rmi.RemoteException
Return the amount of time it took for the tasks to run.

Returns:
The amount of time it took for the tasks to run during the last execution.
Throws:
java.rmi.RemoteException

getAvgRunTime

long getAvgRunTime()
                   throws java.rmi.RemoteException
The average run time for each task.

Returns:
The average run time for each task during the last execution.
Throws:
java.rmi.RemoteException


Anna Sibirtseva & Chris Ferguson, CS 290B