RMI is a high-level Java API for building distributed applications using distributed objects.
The key idea of RMI is its use of stubs and skeletons to facilitate communications between objects. The stub and skeleton are automatically generated, which relieves programmers of tedious socket-level network programming.
For an object to be used remotely, it must be defined in an interface that extends the java.rmi.Remote interface.
In an RMI application, the initial remote object must be registered with the RMI registry on the server side and be obtained using the lookup method through the registry on the client side. Subsequent use of stubs of other remote objects may be passed as parameters through remote method invocations.
RMI is especially useful for developing scalable and load-balanced multi- tier distributed applications.