A short Java RMI tutorial

This is a technical literature study which purpose is to describe the basic parts of Java Remote Method Invocation. Remote Method Invocation, abbreviated as RMI [SUN02, p2], provides support for distributed objects in Java, i.e. it allows objects to invoke methods on remote objects. The calling objects can use the exact same syntax as for local invocations. The Java RMI model has two general requirements. The first requirement is that the RMI model shall be simple and easy to use and the second requirement it that the model shall fit into the Java language in a natural way.

An RMI application is often composed of two separate programs, a server and a client [SUN02 ,p3]. The server creates remotes objects and makes references to those objects accessible. Then it waits for clients to invoke methods on the objects. The client gets remote references to remote objects in the server and invokes methods on those remote objects. The RMI model provides an distributed object application to the programmer [SUN02 ,p3]. It is a mechanism that the server and the client use to communicate and pass information between each other. A distributed object application has to handle the following properties:
• Locate remote objects: The system has to obtain references to remote objects. This can be done i two ways. Either by using RMI’s naming facility, the rmiregistry, or by passing and returning remote objects.
• Communicate with remote objects: The programmer doesn’t have to handle communication between the remote objects since this is handled by the RMI system. The remote communication looks like an ordinary method invocation for the programmer.
• Load class bytecodes for objects that are passed as parameters or return values: All mechanisms for loading an object’s code and transmitting data is provided by the RMI system.

Get pdf download A short Java RMI tutorial

Related Tutorial

Tags: , , , , , , , , , , , , , , , ,

Comments

Leave a Reply