The Remote Interface
Home ] Up ] [ The Remote Interface ] The Remote Implementation ] The Client Program ] Running The Example ]

 

 

We'll create a really trivial Hello server, which implements the following remote interface:

package rmi;

import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * RMI Remote interface for Hello Server
 * @author Bryan Higgs
 */
public interface Hello extends Remote
{
  String sayHello() throws RemoteException;
}

Note that:

  • The interface must extend the java.rmi.Remote interface
  • Each remote method must throw the java.rmi.RemoteException exception.
 
The page was last updated February 19, 2008