public interface RMIInterface extends Remote {
public byte[] geScreen() throws RemoteException;
public byte[] getProcessList() throws RemoteException;
public boolean execute(String command) throws RemoteException;
public boolean messageTo(String msg,String user) throws RemoteException;
public boolean saveImage(byte[] image,String user) throws RemoteException;
public byte[][] getimages(String user,String date)throws RemoteException;
}
Run Code Online (Sandbox Code Playgroud)
上面的RMI接口方法抛出RemoteException,如果我将这些方法包含在try中,并且捕获RemoteException就可以了.