Java s Remote Method Invocation (RMI)

 <  Day Day Up  >  

Java's Remote Method Invocation (RMI)

Although CORBA is very powerful, it is also somewhat complicated. CORBA is independent of many constraints, including programming languages. To provide interoperability across hardware platforms, operating systems, networks, and so on, a certain level of complexity is inherent. One obvious way to overcome this complexity is to limit the variables . For example, we could limit the programming language to a single language. Of course, this will impose a major constraint, but it will also make the implementation much more stable.

Java provides such an implementation called Remote Method Invocation (RMI). RMI provides many of the same functions that CORBA provides; however, it is limited to the Java programming language, and thus is not really an open industry standard.

Java 2 Standard Edition

RMI is part of the Java 2 Standard Edition (J2SE). The Java 2 SDK Standard Edition V1.4 provides many enhancements to RMI. RMI is also supported by the Java 2 Micro Edition (J2ME).


In the previous section on CORBA we related many of the concepts associated with distributed computing. RMI implements theses distributed computing concepts in a proprietary way. Although the obvious disadvantage of using a proprietary is the loss of language support, there are certain advantages. The fact that RMI is part of the core Java services means that it integrates seamlessly into any Java application you might develop. This makes the implementation much more stable. You can also take advantage of the various Java services, such as garbage collection.

Using RMI, a Java object can invoke objects on other Java Virtual Machines on networked computers. Again, the concept is very similar to the CORBA model. Figure 14.5 shows a simple illustration of the RMI model.

Figure 14.5. The RMI Interface/Implementation model.

graphics/14fig05.gif

One of the primary differences between RMI and CORBA is that there really is no distinct ORB. The client and the server communicate via a transport layer that is basically embedded in the virtual machines of the various applications.

As with CORBA, RMI has the concept of stubs and skeletons. A layer called the remote reference layer takes care of referencing the remote objects, using the Transport layer's TCP/IP connection to the server. Again, just as in CORBA, the client calls the object just as though it were a local object. Figure 14.6 shows what the complete RMI model looks like.

Figure 14.6. The RMI stub/skeleton model.

graphics/14fig06.gif

To illustrate , the server has provided the client with various stubs it can use to invoke objects. The client invokes a specific service provided by the server.

 <  Day Day Up  >  


Object-Oriented Thought Process
Object-Oriented Thought Process, The (3rd Edition)
ISBN: 0672330164
EAN: 2147483647
Year: 2003
Pages: 164
Authors: Matt Weisfeld

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net