[ Team LiB ] |
RMI over IIOPJava Remote Method Invocation (RMI) technology run over Internet Inter-ORB Protocol (IIOP) extends Common Object Request Broker Architecture (CORBA) services and distributed computing capabilities to the Java 2 environment. RMI over IIOP DissectedRMI is the Java standard for distributed computing. In simpler terms, RMI enables networked applications to obtain a reference to an object that resides elsewhere in the network, and to invoke methods on that object as though it resides on the local virtual machine. CORBA, which is defined by the OMG (Object Management Group), is a well-known distributed-object programming model that supports a number of languages such as C++ and Smalltalk. IIOP is a communication protocol that works well over heterogeneous networks via the Internet. Because IIOP is a TCP/IP-based proxy, CORBA is one of the many architectures that use it as a communication protocol. The IIOP protocol connects CORBA products from different vendors, ensuring interoperability among them. RMI-IIOP is essentially a marriage of RMI and CORBA. By extending RMI to work over IIOP, the possibilities become endless. In a homogeneous, Java-to-Java environment, RMI-IIOP opens the communication to use the standardized IIOP protocol. But the greatest benefit that can be leveraged from the marriage is that it allows for easier application and platform integration between the components written in C, Smalltalk, and Java components. The components interact using the Interface Definition Language (IDL). Using RMI over IIOP, objects can be passed both by reference and by value over IIOP. WebLogic RMI-IIOPThe WebLogic Server 8.1 RMI-IIOP implementation has the following features:
Figure 34.10 indicates how WebLogic Server acts as a client and as a server for other ORB/RMI clients. Figure 34.10. WebLogic—CORBA integration.With WebLogic RMI over IIOP, remote interfaces can be written in the Java programming language and implemented using Java technology and the Java RMI APIs. Those interfaces can be implemented in any other language that's supported by an OMG mapping and a vendor-supplied ORB for that language. Additionally, clients can be written in other languages using the IDL derived from the remote Java technology–based interfaces. Programming Models: IDL Versus RMIRMI/IIOP can be used with IDL clients and RMI clients. Both models share the following characteristics:
The client program can use only one of the interfaces. That is, it can use either IDL or RMI, but not both. RMI/IIOP with RMI Java ClientsThis programming model combines the power of RMI with the underlying transport mechanism as IIOP. Pure WebLogic RMI clients that use t3 as the communication protocol need to distribute the WebLogic classes to the client layers. IIOP is an industry standard; this aids in easier migration as compared to t3, which is a proprietary standard of BEA. RMI/IIOP with CORBA/IDL ClientsIn this programming model, non-Java clients and Java objects can seamlessly interoperate in the same environment using RMI/IIOP as the transport mechanism. IDL interfaces can be generated from the Java code, which can integrate with the WebLogic Server. The model involves an ORB and a compiler that creates an IDL interface. RMI/IIOP with a Tuxedo DomainThe WebLogic to Tuxedo Connector described earlier uses RMI/IIOP as the underlying transport mechanism to integrate Tuxedo domain applications with the WebLogic Server. WTC also enables Tuxedo to invoke WebLogic Server EJBs and other applications in response to a service request. RMI/IIOP with EJBEnterprise JavaBeans use RMI over IIOP for their distributed object model. EJB interoperability in heterogeneous server environments is achieved when EJBs are implemented using the RMI over IIOP protocol. Coupling EJBs with CORBA with RMI/IIOP provides the following advantages:
The mapping information needed for the CORBA/IDL clients can be generated from the EJB interfaces using the WebLogic utility weblogic.ejbc. The IDL files it generates represent the CORBA definition of the EJB interface. WTC and CORBA InteroperabilityWTC enables objects deployed in WebLogic Server to invoke CORBA objects deployed in a Tuxedo domain. The CORBA Java outbound API defines the following procedures for the interoperability of WebLogic Server objects into Tuxedo CORBA objects:
In Listing 34.6, the code provides an example of invoking a simple WTC ORB using the concepts described earlier. Listing 34.6 Simple WTC ORB Invocationthrows RemoteException { System.out.println("Welcome " + aName); try { // Initialize the ORB. String [] greets Properties Prop; Prop = new java.util.Properties(); Prop.put("org.omg.CORBA.ORBClass","webLogic.wtc.corba.ORB"); ORB orb = (ORB)c.lookup("java:comp/ORB"); // Get the Greeting factory. org.omg.CORBA.Object greeting_fact_oref = orb.string_to_object("corbaname:tgiop:helloWorldp#Greeting_factory"); //Narrow the Greeting factory. GreetingFactory greeting_factory_ref = GreetingFactoryHelper.narrow(greeting_fact_oref); // Find the simple object. Greeting greet = greeting_factory_ref.find_greeting(); // find salutation String salutation = GreetingFactoryHelper.findSaluation(aName); // Format a Greeting org.omg.CORBA.StringHolder wish= new org.omg.CORBA.StringHolder("Hello "+salutation+" "+ aName); return wish.value; } catch (Exception e) { throw new RemoteException("Unable to invoke TUXEDO CORBA server: " +e); } } Additionally, Tuxedo CORBA objects can invoke EJB services deployed in WebLogic Server. The CosNaming service has bound WebLogic Server's name service, which the client can use to locate the required service. LimitationsThere are some inherent limitations to using RMI-IIOP on both the client and server. Some of the limitations are
|
[ Team LiB ] |