RMI

Java RMI Projects

RMI PROJECT 1

adplus-dvertising
Introduction of RMI
Previous Home Next

The RMI (Remote Method Invocation) is work like to the remote procedure calls (RPC). All RMI(Remote Method Invocation) function found in the java.rmi package. The protocol need to run java-only implementation is known as Java Remote Method Protocol (JRMP) and in order to run in non-JVM, then CORBA is used.

Generally RMI break in two separate programs, a server and a client. A server program is used to create the some remote objects, and makes references to these object which is always wait for client to invoke methods through these objects. When server and client communicate and pass their information such type of application is sometimes referred to as distributed object application.

The Java RMI allow programmer to execute remote function which behave similar to local functions calls but the difference is that it exits somewhere else.

In the RMI firstly the server need the name to bind it the registry because the RMI server bind the remote object with name on same host. Clients on local and remote hosts can then look up remote objects and can pass message one to another. The client lookup for the server name in the registry to establish the remote references.

The RMI use a command which name rmic which is used to generates stubs and skeletons, ties for remote objects using either the JRMP or IIOP protocols. These classes files are generated from the compiled Java files classes that contain remote object implementations.

The stub is used to play the responsibly of sending the remote call which passes over to the server-side skeleton The stub opening a socket to the remote server, marshaling the object parameters and forwarding the data stream to the skeleton.

A skeleton contains a method that receives the remote calls, unmarshals all the parameters, and invokes the actual remote object implementation. And once you started the Registry, the server will be started and able to store itself in the Registry.

Previous Home Next