Advanced Java Programming:
RMI

RMI enables the programmer to create distributed Java-based applications in which the methods of remote Java objects can be invoked from other Java virtual machines (JVM), possibly on different hosts. It closely parallels the older RPC (Remote Procedure Call) sockets-based client-server mechanism. A Java program can call a method on a remote object after it obtains a reference to the remote object. This reference is obtained either by looking up the remote object in the Java naming service provided by RMI or by receiving the reference as an argument or a return value. A client can call a remote object in a server which itself can be a client of other remote objects, so that RMI can be bi-directional between a client and server.

One of the biggest advantages of RMI over other remote processing methods is that in a purely Java system design, the RMI remote methods calls look identical to normal, local, method calls. There are, of course, rules to follow to be sure code will work with RMI and there is some small overhead to initiate the client/server connection. The fact that remote methods look like local methods helps promote good object-oriented design without encumbering the design with too many client/server communication details.

See the Remote Method Invocation(RMI) tutorial http://java.sun.com/docs/books/tutorial/rmi/index.html for more information.