Research and Analysis (Remote Method Invocation: Mechanisms)
A Distributed system (DS) is a model/collection of independent computers linked together through a network which produce an integrated computing facility using software programs (middleware). Some widely-used DS are Word Wide Web (WWW), Email, Cloud services like Google drive and Dropbox, teleconferencing services like Skype. In Distributed communication, services provided by a server can be accessed by multiple clients. “The goals in mind while implementing distributed systems are – scalability, reliability, openness, transparency and performance” (Lee , 2007). Inter-process communication is at the core of DS, and there are different ways to achieve that for example – Message Oriented or Stream Oriented communication but for this research report will focus primarily on Remote Method Invocation (RMI) which is a Java implementation of Remote Procedure Calls (RPC) that allows server and client software to communicate with each other.
Let’s, look at high level details about RMI: Remote Method Invocation is an object-oriented Application Programming Interface which allows the creation of distributed applications using Java and this distributed environment supports/allows different computers running Java Virtual Machine (JVM) to communicate with each other using stub (on client side) and skeleton (on server side). Stub and Skeleton are responsible for marshalling and un-marshalling data, the RMI allows an object on client to invoke methods/services on an object on the server running JVM. RMI does this in a way that the client application thinks its invoking a local Java object’s methods.
There are several RMI alternatives which can be used but Common Request Broker Architecture (CORBA) is a serious competitor to RMI that can also be used to create distributed systems using Java. For this report, we will not study CORBA in detail but some important points may need to be addressed.
CORBA wins from RMI in terms of performance but RMI is easy to implement and communication is straight forward through RMI’s wire level protocol, the original, Remote Java Object communication in RMI occurs using the Java Remote Method Protocol (JRMP).But in CORBA communication happens over Internet Inter-Orb Protocol (IIOP) and it is necessary to keep in mind IIOP stubs are properly connected with ORB (Object Request Broker) before starting operations on IIOP stub whereas this is not required with JRMP. Java implementation of CORBA/IIOP is known as Java IDL (Interface Definition Language) and supports mapping for Java. Which is Java IDL, helps to define, implement and access CORBA object using Java. Previously, Java developers had to choose between RMI and Java IDL.
These days, RMI-IIOP is widely used to bring CORBA capabilities to Java platform with some limitations. RMI over IIOP provides Java developers the freedom to write CORBA applications without learning CORBA IDL.
So, far we understand that RMI allows communication between remote computers. And we also looked at RMI alternative CORBA. Well, it’s hard to say one is better than the other. Now, let’s look at RMI Architecture Diagram and RMI mechanisms that allows back and forth communication between server and client.