Vol 4 Issue 1 M 10
Vol 4 Issue 1 M 10
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
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
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
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
creates .class files for all the java files as shown in the below
Figure 7.