RMI(Remote Method Invocation)

To develop a distributed application in java, we use RMI mechanism. RMI is an API that provides a mechanism to create distributed application. The RMI allows an object to invoke methods on an object running in another machine(JVM).
It is providing a facility where remote communication is doing between the applications using two objects stub and skeleton. So let’s first understand about stub and skeleton.
RMI uses stub and skeleton object for communication with the remote object.
remote object is an object whose method can be invoked from another JVM.
stub
The stub is an object present in client side. Basically it is a proxy object that means it represents the remote object. It acts as a gateway for the client side. When a method is invoked on the stub object, then it performs following tasks:

  1. It initiates a connection with remote Virtual Machine (JVM),
  2. It writes and transmits (marshals) the parameters to the remote Virtual Machine (JVM),
  3. It waits for the result
  4. It reads (unmarshals) the return value or exception, and
  5. It finally, returns the value to the caller.

skeleton
The skeleton is an object, acts as a gateway for the server side object. All the incoming requests are routed through it. When the skeleton receives the incoming request, it does the following tasks:

  1. It reads the parameter for the remote method
  2. It invokes the method on the actual remote object, and
  3. It writes and transmits (marshals) the result to the caller.

  4.  

 

 

Our Services:

Java Training | Python Training | Machine Learning with Python Training | Deep Learning with Python Training | Data Science with Python Training | Projects

SILAN Technology, BBSR
Call to: 9439202111  |  9658317757  |  0674-2361252

Comment