import java.io.Serializable; import java.rmi.Remote; import java.rmi.RemoteException; /** * Interface for worker process in simple master/worker example using RMI. * (Apparently both a class and an interface are needed for RMI remote objects.) * Classes implementing this interface must override "equals" in a way that will * allow the master process to identify two workers as "the same" even though * the representing objects (as passed to its methods via RMI) are different. */ public interface RMIWorkerInterface extends Remote, Serializable { /** * Gets hostname for worker. */ String hostName() throws RemoteException; /** * Gets total number of tasks completed by worker. */ int numTasks() throws RemoteException; /** * Gets total time used by worker. */ int totalTime() throws RemoteException; }