The Hello World RMI Example

The code shown below is the remote interface definition for our first RMI example. As we explained previously, this interface must declare the remote methods that will be exposed to client objects. This example declares a single method, the helloThere method, which takes a string argument for a name (which will be used in the response). The method returns a string value and must be declared to throw a RemoteException. The arguments to and the return values from any method declared in this interface can be Java primitive data types or objects that are serializable (implementing java.io.Serializable), and must conform to the restrictions of serializable objects. The interface itself must extend the java.rmi.Remote interface, ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.