Java Remote Method Invocation over Internet Inter-ORB Protocol Technology

Java Remote Method Invocation (RMI) over CORBA's Internet Inter-Orb Protocol (IIOP) combines the best features of Java RMI technology with the best features of CORBA technology. The Enterprise JavaBeans architecture adopted RMI/IIOP as its standard communication protocol. Here we briefly discuss RMI and CORBA's IIOP and their benefits. This discussion will help you to better understand the next section, “Remote and Local Interfaces.”

In the Java distributed object model, a remote object is one whose methods can be invoked from another Java Virtual Machine (JVM), potentially on a different host. An object of this type is described by one or more remote interfaces, which are Java interfaces that declare the methods of the remote object. A remote interface must at least extend, either directly or indirectly, the interface java.rmi.Remote.

Remote method invocation is the action of invoking a method of a remote interface on a remote object. RMI uses a standard mechanism for communicating with remote objects: stubs and skeletons. A stub for a remote object acts as a client's local representative or proxy for the remote object. The caller invokes a method on the local stub, which is responsible for carrying out the method call on the remote object. In RMI, a stub for a remote object implements the same set of remote interfaces that the remote object implements.

When a stub's method is invoked, it does the following:

  • Initiates a connection with the remote JVM containing the remote object.

  • Marshals (writes and transmits) the parameters to the remote JVM.

  • Waits for the result of the method invocation.

  • Unmarshals (reads) the return value or exception returned.

  • Returns the value to the caller.

The stub hides the serialization of parameters and the network-level communication in order to present a simple invocation mechanism to the caller.

In a remote JVM, each remote object may have a corresponding skeleton. A skeleton is responsible for dispatching the call to the actual remote object implementation. When a skeleton receives an incoming method invocation, it does the following:

  • Unmarshals (reads) the parameters for the remote method.

  • Invokes the method on the actual remote object implementation.

  • Marshals (writes and transmits) the result (return value or exception) to the caller.

RMI provides the benefit of location transparency. Clients aren't aware of the location of the remote object. From the client's perspective, it makes no difference whether the remote object is in the same JVM as the client, in a different JVM but on the same machine as the client, or on a different machine from the client.

CORBA (Common Object Request Broker Architecture) is an industry-developed standard for communication among objects. It includes a communication protocol for interobject communication called Internet inter-orb protocol. A key feature of CORBA is its interoperability across platforms, languages, and vendors.

EJB adopted Java Remote Method Invocation (JRMI) over RMI/IIOP as the standard communication protocol. This allows maximum flexibility such as location transparency and interoperability. Other protocols are permitted, but IIOP is required for conformational EJB implementations to interoperate with one another.

You write the Enterprise JavaBean class itself, plus the bean's home and component interfaces. The client-side implementations of the home and component interfaces (the home class and component class) are generated by deployment tools, and handle the communication between the client and the EJB container. Clients can access an Enterprise JavaBean only through the bean's home and component interfaces.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.96.86