0% found this document useful (0 votes)
49 views6 pages

Vol 4 Issue 1 M 10

The document discusses Remote Method Invocation (RMI) which allows objects in different computers to interact. RMI aims to provide transparency regarding distribution. It provides a way for remote objects to be called as if they were local. RMI is an important part of distributed systems, located in the middleware layer. It allows for remote method calls between systems in a distributed, heterogeneous environment in a way that hides the distribution details. The document outlines the basics of how RMI works and its advantages for developing distributed applications.

Uploaded by

Mahdi Akbari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views6 pages

Vol 4 Issue 1 M 10

The document discusses Remote Method Invocation (RMI) which allows objects in different computers to interact. RMI aims to provide transparency regarding distribution. It provides a way for remote objects to be called as if they were local. RMI is an important part of distributed systems, located in the middleware layer. It allows for remote method calls between systems in a distributed, heterogeneous environment in a way that hides the distribution details. The document outlines the basics of how RMI works and its advantages for developing distributed applications.

Uploaded by

Mahdi Akbari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

International Journal of Emerging Technologies in Engineering Research (IJETER)

Volume 4, Issue 1, January (2016) www.ijeter.everscience.org

Transparency in Remote Method Invocation (RMI)


for Distributed Systems: Middleware Layer
D.Madhavi
Assistant Professor, Andhra Loyala Institute of Engineering and Technology, India.

Abstract – Remote Method Invocation (RMI) is a mechanism without affecting its services. Openness is the syntaxes and
that allows objects located in a different computers in a semantics of a system can be able to open to the developer as
computer network to interact with each other. The main goal of well as user to access the services without knowing how they
RMI is to provide the full transparency regarding Distribution. are implemented internally even in a heterogeneous
This article gives the overall view of the working procedure of
environment.
Remote Method Invocation and how it aims to be distribution
transparency. Achieving distribution transparency is not an easy
task in a distributed systems but this can be done through RMI.
RMI is most important and currently most popular concept that
need to be known by any one because it is used in so many
applications such as internet search engines, social websites,
distributed file systems, various mailing systems, online groups
etc. This paper demonstrates clearly about RMI and its
Transparency.
Index Terms – RMI, RMI Registry, Distributed Objects, Proxy,
Skeleton, Marshalling.
1. INTRODUCTION
Figure 1 Structure of Distributed System
Distributed System is a collection or group of independent or
RMI is the most important part of distributed system placed in
autonomous systems that appears to its end-users as a single
the middleware layer of it. If any one method that is called by
coherent system. The Structure of Distributed System [1] is
a client system is not presented in it, but that method
shown in the below Fig. 1. It consists of user applications,
definition is presented in the other system on either client or
middleware layer and local operating systems. User
system then we need an RMI. RMI is the one such concept
applications are presented on top of the middleware layer and
without which the Distributed system is not designed to
consist of all the distributed system applications run by the
provide transparency especially distribution transparency.
different users. Middleware layer is logically placed in
This paper discuss about what is the architecture of RMI,
between user applications and local operating system. It acts
working of RMI, in which layer the RMI is presented in
as an interface between distributed applications and local
distributed system and how it is implemented with
operating systems. Examples of middleware layer are
advantages.
CORBA, DCOM etc. local operating systems of different
computers in a distributed system, which is presented at the RMI is a mechanism to allow access to the remote object
lower of all the layers. Different systems in a distributed which is presented on another remote machine connected in a
system are having different operating system. Operating network within a distributed system. Java RMI is quite similar
system provides its services supported by the middleware to RPC (Remote Procedure Call). i.e RMI is java’s version of
layer. RPC with its object orientated concepts. Basically RMI is
only a version of CORBA (Common Object Request Broker
The three fundamental properties of a Distributed System are
Architecture) by supporting its remote object invocation
Transparency, Scalability and Openness. Transparency means
concepts where as RPC does not allow object invocation it
hiding of resources, data, location, access, migration,
only calls the procedures which are presented on remote
relocation, replication, network, concurrency, failures
machines. The protocols used for implementation of RMI
occurred in a distributed system. Among all these distribution
systems are JAVA RMI, CORBA IDL (Interface Definition
transparency is the important thing which aims to reach goal
Language), Microsoft DCOM (Distributed Component Object
of a system. This can be achieved through middleware layer
Model) /COM+, SOAP (Simple Object Access Protocol).
as shown in the Figure 1. Scalability is the ability of
Java RMI is implemented only in java object oriented
increasing or decreasing of resources or systems in a
concepts. CORBA uses CDL (Common Definition Language)
distributed system. It depends up on the capacity of a system
[2, 3] to represents, call, reference remote objects and to

ISSN: 2454-6410 ©EverScience Publications 44


International Journal of Emerging Technologies in Engineering Research (IJETER)
Volume 4, Issue 1, January (2016) www.ijeter.everscience.org

support object oriented concepts. Sun Micro systems  Easy to develop and use
developed a DCOM model for supporting RMI. SOAP  Dynamic class loading is very powerful
protocol presents RMI on top of HTTP. It is a part of  Parallel computing
middleware layer as shown in the Figure 2.  Distributed Garbage Collection
 Security and Safety
 Connections to Legacy systems using JINI

The Disadvantages of Java RMI are


 Insecure while dynamic class loading
 Challenging and hard to implement call back
mechanism over Internet.
 Overhead of Object serialization, marshalling and
Figure 2 RMI is in Middleware Layer unmarshalling.
Distributed Systems uses Request-Reply protocol [2] for  Supports only JAVA RMI.
client-server communication as shown in the Figure 3. It is a
2. RELATED WORK
part of middleware layer. This protocol supports three
methods named as doOperation, getRequest and sendReply. It The first Java RMI [7] core library supports built-in
provides certain delivery guarantees. RMI passes a remote functionality for distributed computing. Basically distributed
object reference in the request message and that method is systems are built on hertogenious environment so that they
invoked on the remote system. support first versions of java release, as time progresses new
releases of java supports CORBA through RMI-IIOP. Later
Sun Microsystems supports distribution capabilities for java
and introduces Jini, in 1998 by Apache River. It supports
secure distributed applications and services which are
facilitated by Jini Extensible Remote Invocation Protocol
(JERI) using JavaSpaces [9]. JERI is not equal to RMI but
systemically similar to RMI. River also targeted towards to
grid computing. It allows the Java Remote Method Protocol.
Cajo library to build distributed java virtual machines and
Figure 3 Request-Reply Communication uses RMI. It reduces network traffic, controls and agent
objects exchanged between virtual machines. It uses multicast
Multithreading concept is used to invoke a method on a communication.
remote object presented in remote machine. In practice, RMI
is the client to hold references to remote objects that it can CloudSNAP [8] is a platform for decentralized systems on
invoke methods on. These references should behave just like a J2EE web applications. DAMON (Aspect Oriented
local objects, but when invoked dispatch the method Interception Middleware) is used to achieve distribution of
invocation to the remote object. Because need to refer to both objects. It uses the underlying architecture as P2P Network. It
and a method now, not just a function so it sends an object id is better used for Cloud Enterprise web applications.
across the socket, then the method and the arguments. The P2P-MPI [10] is a project to support Parallel P2P grid
server then dispatches the method to the remote object based computing. This framework extends for resource sharing and
on id and method name, interface name in which the method Message passing interface Infrastructure. So that acts as a
defined. The flow of Communication mechanism during the computational grid.
execution of a remote method for RMI from client to server is
JXTA protocol provides definition and library to build P2P-
Client  Interface  Stub  Skeleton  Interface based distribution of java objects. JXTA is independent.
 Server
All of the above does not provide full efficient transparent
The primary advantages of Java RMI [4, 5] are integration of simple object oriented approach but P2P RMI
 Object Oriented [6] provides this full distribution transparency.
 Mobile behavior 3. PORPOSED MODELLING
 Parallel computing
The architecture of RMI is shown in the below Fig.2. Before
 Distributed Computing
performing the RMI operation specified in the architecture,
 Write once run anywhere

ISSN: 2454-6410 ©EverScience Publications 45


International Journal of Emerging Technologies in Engineering Research (IJETER)
Volume 4, Issue 1, January (2016) www.ijeter.everscience.org

first bind a client to a server is performed as shown in the messages to return the result of the method invocation to the
Figure 4. client.
Step 4: Then proxy is converted that message into the
required protocol format used for communication such as
HTTP, SOAP… etc, this process of converting method
arguments to message formats suitable for transmission in a
computer network is called marshalling.
Step 5: After marshalling the data is given to Client
Operating System which converts the data into binary format
understandable by the Physical Layer.
Step 6: Server Operating System takes binary data and
reformat and hand it over to the Server Stub called Skeleton.
Figure 4 Binding a Client to the Server System
Step 7: Skeleton unmarshals requests to proper method
Binding a client system to the server is done in the three steps. invocations at the object’s interface at the server.
They are
Step 8: The dispatcher selects the appropriate method in the
Step 1: Server must register the object’s interface at RMI Skeleton. Dispatcher has Object in which methods are
registry. defined.
Step 2: If client wants to access the remote object then it Step 9: After Server does work, it returns result to the
looks up in the RMI registry. Skeleton.
Step 3: After getting the object’s interfaces implementations Step 10: The Skeleton also marshals replies and forwards
into the client’s address space, the actual RMI mechanism is replies to the client-side Operating System through Computer
taken place. network.
The RMI architecture and have the following steps as shown Step 11: Client OS takes and handover it to the Proxy, then it
in the Figure 5. unmarshals the data
Step 12: The unmarshaled data is handover to the requested
Client process.
The RMI structure offers full transparency regarding
distribution.
Objects can be implemented in different ways. There are
various categories of objects are there named as
 Compile time Objects
 Runtime Objects
 Distributed Objects
 Remote Objects
 Persistent Objects
 Transient Objects
Figure 5 Simple Model / Architecture of RMI
Step 1: The server first registers their interfaces at the RMI 3.1 Compile-Time Objects:
registry i.e binding a client to a server. o Compile time objects are directly related to language
level objects supported by Java and C++.
Step 2: The client machine which it wanted to invoke a o The most obvious form of objects are known as
method on remote machine can generate the stub. It has compile time objects.
objects id, method name, server reference be marshaled by the o They are easy to build distributed system
client stub is called the proxy. applications using compile time objects.
Step 3: The proxy provides an implementation of interface as o Drawback of compile time objects is dependent on
the server object which marshals method invocations into particular programming language.
messages, sends into the target, waits and unmarshals reply

ISSN: 2454-6410 ©EverScience Publications 46


International Journal of Emerging Technologies in Engineering Research (IJETER)
Volume 4, Issue 1, January (2016) www.ijeter.everscience.org

o In compile time objects, objects are defined as an Dynamic RMI:


instance of a class.  It can be able to compose a method invocation at
3.2 Runtime Objects runtime. It can also refer to as dynamic invocation.
o The implementation of Runtime objects are left  An application selects at runtime which method it
open. will invoke at a remote object.
o This approach to Object-based Distributed Systems
allows an application to be constructed from objects There is a drawback to RMI, it provides inherently
written in multiple languages. synchronous nature. Even though it contributes to hiding the
o This approach may use object adapters that acts as communication in Distributed System unfortunately this
wrappers that give implementations of an object mechanism is not always appropriate. Client is blocked until
appearance. its requests have been processed. There is a necessicity of
3.3 Distributed Objects using another mechanism called Message Oriented
o It is an Object which publishes its interface on other communication to avoid this drawback.
machines
o The characteristic of the Distributed object is that 4. RESULTS AND DISCUSSIONS
their state is not distributed.
o It is constructed during explicitly runtime RMI effectuation generates stub at client side and skeleton at
o It is followed in many object based distributed server side on which actual implementation of an interface is
systems, which are independent of programming defined. In the process of RMI implementation, Client
languages. machine uses RMIregistry as in Figure 4. to bind to a
o Applications can be constructed from objects written particular server in a network of Distributed System. A result
in multiple languages. of implementation of RMI using an object oriented language
3.4 Remote Objects known as JAVA is shown in this section.
o It is a distributed object whose state is encapsulated Consider a simple arithmetic operations whose method
(Objects state is not distributed here). definitions are not available on the client system then it can
o Objects implementation is left open. Object methods invoke those required methods which are existed at server
are invoked from remote systems. machine or another machine which is placed remotely in a
o The remote object is based on id and method name. Distributed System. Then this scenario uses the RMI
3.5 Persistent Objects mechanism. This paper gives an example for addition,
o It continues to exist even if it is currently not subtraction, multiplication and division operations, whose
contained in the address space of a server process. method definitions are found on another machine.
o These objects are not dependent on its current server.
o Server manages this object then it stores into The Figure 6 Shows the three different Java files named as
secondary memory and exit. ClientRMI.java, to represent client side code,
3.6 Transient Objects ServerRMI.java, represents server side object oriented code
o This object exists only as long as the server that and InterfaceRMI.java, which specifies the interface
manages the object. definition.

Basically RMI is of two types they are Static RMI and


Dynamic RMI.

Static RMI:
 After binding of a client to a server, it can invoke the
object’s methods through proxy
 The preferred interface definitions referred to as
static invocation. Here interfaces of an object are
known when the client application is being
developed.
 If interfaces can change then the client application
must be recompiled before it can make use of new
interfaces. Figure 6 Creation of Client, Server and Interface Files
 The preferred interface definitions are presented in
CORBA’s IDL. After creation of all the java files there is a need to compile all
the created java files using Java compiler named as Javac. It

ISSN: 2454-6410 ©EverScience Publications 47


International Journal of Emerging Technologies in Engineering Research (IJETER)
Volume 4, Issue 1, January (2016) www.ijeter.everscience.org

creates .class files for all the java files as shown in the below
Figure 7.

Figure 10 Executing the Command start rmiregistry


Figure 7 Compilation of .java Files
The java compiler compiles all the files and generates the
.class files as shown in below Figure 8.

Figure 11 Starting RMI Registry Service


Open a new separate environments for both server and client
side execution of programs by running server and client
Figure 8 Creation of .class Files program consecutively as shown in the below Figure 12 and
Figure 13.
RMIRegistry is started on a system which generates the Stub
class named as ‘ServerRMI_Stub.class’ for the interface as Binding a client to a server can be done by executing rmi
shown in the below figures Figure 9 and Figure 10 and as a registry. After that execution of server program can be done
result of RMI registry the service of registry started by Figure 12.
opening a new command window as shown in Figure 11.

Figure 12 Execution of ServerRMI

Figure 9 Generation of Stub Class, ServerRMI_Stub.class

ISSN: 2454-6410 ©EverScience Publications 48


International Journal of Emerging Technologies in Engineering Research (IJETER)
Volume 4, Issue 1, January (2016) www.ijeter.everscience.org

[10] Stephane Genaud and Choopan Rattanapoka,”A Peer-to-Peer


Framework for Message Passing Parallel Programs”, Advances in
Parallel Computing, Volume 17, pages 118-147. IOS Press, June 2009.

Figure 13 Execution of ClientRMI


5. CONCLUSION
Remote Method Invocation is presented in the Middleware
layer of a Distributed System. This layer is heart or central
part of all the systems in a Distributed System. The important
property of distribution transparency is provided by this Layer
with the help of RMI. That is implementation of transparency
is done in middleware layer through RMI and interoperability
issues are also provided as discussed in the above section of
this paper. Transparency is the main goal of RMI. Without
transparency there is no Distributed System. It places the
major role of design and implementation of any Distributed
System. Achieving full transparency is not possible but
maximum extent it will be achieved depending upon the
application.
REFERENCES
[1] Andrew S. Tanenbaum, Maarten Van Steen, “Distributed Systems:
Principles and Paradigms”, Eastern Economy Edition, PHI Learning
Private Limited, Second Edition. ISBN-978-81-203-3498-4.
[2] George Coulouris, Jean Dollimore and Tim Kindberg, “Distributed
Systems Concepts and Design”, Pearson education, Fourth Edition.
[3] Hanumant Pawar, Sujeet Patil, Sourabh Karche, Udit Upadgayay,
Mahesh Channaram, “Distributed Object Computing Using Java
Remote Method Invocation”, International Journal of Emerging
Research and Technology, Volume 3, Issue 5, May 2015, PP 68-76,
ISSN 2349-4395 (Print) and ISSN 2349-4409 (Online).
[4] Integrated Cloud Applications & Platform Services, “Java Remote
Method Invocation- Distributed Computing for Java”, ORACLE
Technology Network, Technologies.
[5] Kapep, Rafalmag, Rob Lachlan, “Benefits and Disadvantages of using
java rmi”, Stack Overflow Community, Stack Exchange Inc., Licensed
under cc by-sa3.0, 6th June 2014, 30th Oct 2012, 26th Feb 2016
respectively.
[6] Thomas Zink, Oliver Haase, Jurgen Wasch and Marcel Waldvogel,
“P2P-RMI: Transparent Distribution of remote java Objects”,
International Journal of Computer Networks & Communications
(IJCNC) Vol. 4, No. 5, September 2012.
[7] Ann Wollrath, Roger Riggs, and Jim Waldo, “A Distributed Object
Model for the JAVA System”, USENIX Computing Systems, 9, 1996.
[8] Ruben Mondejar, Pedro Garcia-Lopez, Carles Pairot, and Lluis Pamies-
Juarez, “CloudSNAP: A Transparent Infrfastructure for Decentralized
web deployment using Distributed Interception”, Future Generation
Computer Systems, (0), 2011.
[9] Qusay H.Mamoud, “Getting Started With JavSpaces Technology:
Beyond Conventional Distributed Programming Paradigms”, July 2005.

ISSN: 2454-6410 ©EverScience Publications 49

You might also like