Java RMI - Remote Method Invocation

 

JavaRMI/IIOP

RMI/ Internet Inter-ORB Protocol Technology

RMI

java.rmi package

main interface java.rmi.Remote

remote method invocation = invoking a method of a remote interface on a remote object.

stubs and skeltons are used for this communications

stubs = stub for a remote object acts as a client's local representative or proxy for the remote object. Caller invokes method on local stub which in turn is responsible for carrying out the method call on the remote object.

  • initiates a connection with remote JVM containing matching remote object
  • Marshals (writes and transmits) the parameters to remote JVM
  • waits for results of method invocation
  • Unmarshals (reads) the return value or exception returned.
  • Returns values to caller


skeleton =
in remote JVM, each remote object has a corresponding skeleton. Responsible for dispatching the call to the actual remote object.

  • Unmarshals (reads) parameters
  • invokes method on actual object
  • Marshals (writes and transmits) the result (return value or exception) to the caller.

IIOP

Part of CORBA, communication protocol for interobject communications.