Example: a Printer Directory
Perhaps more relevant on LAN than the Internet, but it illustrates the idea:
public interface Printer extends Remote {
void print(String document) throws RemoteException ;
}
public interface PrinterHub extends Remote {
Printer getPrinter(int dpi, boolean isColor)
throws RemoteException ;
}
A client might initially obtain a PrinterHub reference from the RMI registry. The remote object contains some table of printers on the network.
An individual Printer interface is returned to the client, according to specifications given in getPrinter().