Remote Method Invocation

Only available on StudyMode
  • Download(s) : 346
  • Published : January 21, 2011
Open Document
Text Preview
I1 Introduction
Distributed systems require entities which reside in
different address spaces, potentially on different machines, to communicate. The Java™ system (hereafter
referred to simply as “Java”) provides a basic communication mechanism, sockets [13]. While flexible and
sufficient for general communication, the use of sockets
requires the client and server using this medium to
engage in some application-level protocol to encode
and decode messages for exchange.
An alternative to sockets is Remote Procedure Call
(RPC) [13]. RPC systems abstract the communication
interface to the level of a procedure call. Thus, instead
of application programmers having to deal directly
with sockets, the programmer has the illusion of calling
a local procedure when, in fact, the arguments of
the call are packaged up and shipped off to the remote
target of the call. Such RPC systems encode arguments
and return values using some type of an external
data representation (e.g., XDR).
RPC, however, does not translate well into distributed
object systems where communication between program-
level objects residing in different address spaces
is needed. In order to match the semantics of object
invocation, distributed object systems require remote
method invocation or RMI. In such systems, the programmer
has the illusion of invoking a method on an
object, when in fact the invocation may act on a remote
object (one not resident in the caller’s address
In order to support distributed objects in Java, we
have designed a remote method invocation system that
is specifically tailored to operate in the Java environment. Other RMI systems exist (such as CORBA) that
can be adapted to handle Java objects, but these systems
fall short of seamless integration due to their inter-
operability requirement with other languages.
CORBA presumes a heterogeneous, multi-language
environment and thus must have a language neutral
object model. In contrast, the Java language’s RMI
system assumes the homogeneous environment of the
Java Virtual Machine, and the system can therefore
follow the Java object model whenever possible.
We identify several important goals for supporting
distributed objects in Java:
• support seamless remote invocation between Java
objects in different virtual machines;
• integrate the distributed object model into the Java
language in a natural way while retaining most of
Java’s object semantics;
A Distributed Object Model for the Java™ System
It is most important
that remote method invocation in Java be simple
(easy to use) and natural (fit well in the language).
In addition, the RMI system should perform garbage
collection of remote objects and should allow extensions
such as server replication and the activation of
persistent objects to service an invocation. These extensions are transparent to the client and add minimal
implementation requirements on the part of the servers
that use them.
In this paper we will briefly describe the Java object
model, then introduce our distributed object model for
Java. We will also describe the system architecture
and relevant system interfaces. Finally, we discuss related
work and conclusions.
3 Distributed Object Model
In our model, a remote object is one whose methods
can be accessed from another address space, potentially
on a different machine. An object of this type is described
by a remote interface, which is an interface (in
Java) that declares the methods of a remote object.
Remote method invocation (or RMI) is the action of
invoking a method (of a remote interface) on a remote
object. Most importantly, a method invocation on a remote
object has the same syntax as a method invocation
on a local object.
Clients of remote objects program to remote interfaces,
not to the implementation classes of those interfaces.
Since the failure modes of accessing remote
objects are inherently different than the failure semantics...
tracking img