|
Here are the remote interfaces for our time server.
First, the interface to the Time server's functionality:
package rmi;
import java.rmi.Remote;
import java.rmi.RemoteException;
import rmiClient.TimeMonitor;
/**
* A Time interface
* @author Bryan Higgs
*/
public interface Time extends Remote
{
void registerTimeMonitor(TimeMonitor monitor) throws RemoteException;
}
|
Next, the interface to the client's callback functionality:
package rmiClient;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Date;
/**
* A TimeMonitor interface
* @author Bryan Higgs
*/
public interface TimeMonitor extends Remote
{
void tellMeTheTime(Date time) throws RemoteException;
}
|
Note that:
- The Time interface makes reference to the TimeMonitor interface.
- Both are specified as implementing the Remote interface.
|