(a)
import java.rmi.RemoteException;
import java.rmi.Remote;
public interface PrintRemote extends Remote {
    String print(String printerName, String fileName) 
        throws RemoteException;
    String checkQueue(String printerName) 
        throws RemoteException;
}

(b)
javac PrintRemote.java

(c)
rmic PrintRemote

Example 2: Creating a print-service interface. (a) writing a Java interface to extend Remote; (b) compiling the class file with the javac compiler; (c) compiling the class file with the RMI compiler.

Back to Article
Copyright © 1999, Dr. Dobb's Journal