/** * Generic example of master/worker program. * * "Tasks" just consist of sleeping for a specified time; times to wait are * generatedly randomly from 1 to a specified maximum. * * Interface for master process for client/server version using RMI. * * RMI specifics in this example are loosely based on an example from * Sun's online tutorial. */ package csci3366.sample.masterworker.rmi; import java.rmi.Remote; import java.rmi.RemoteException; import csci3366.sample.masterworker.FakeTasks; public interface MasterInterface extends Remote { static final String BINDING_NAME = MasterInterface.class.getName(); static final int REGISTRY_PORT = 1099; /* default plus one */ /** Register new worker (returns worker ID). */ int registerNewWorker(WorkerInterface w) throws RemoteException; /** Get task from queue (null if none). */ FakeTasks.Task getTask(WorkerInterface w) throws RemoteException; /** Accept result for single task from worker. */ void reportResult(WorkerInterface w, FakeTasks.Task t, FakeTasks.TaskResult tr) throws RemoteException; /** Accept summary result for worker. */ void reportSummaryResults(WorkerInterface w, int numTasks, int totalTaskTime) throws RemoteException; }