Home Segments Top Top Previous Next

1022: Mainline

Similarly, at the time that the MovieDataObserverForTable or ClientStub class are compiled, on the client computer, all the compiler needs to know about the RatingServer class is that there is a serverRating method, with a particular signature, which is provided adequately by an interface, RatingServerInterface.

Note that the RatingServerInterface not only specifies the serverRating method, but also extends the Remote interface, which informs the compiler that not only must implementing classes implement the specified method, but also that the method is to be called by a client and run on a server.

import java.io.*; 
import java.rmi.*; 
public interface RatingServerInterface extends Remote { 
 public abstract int serverRating(MovieInterface m)  
  throws RemoteException ; 
}