0% found this document useful (0 votes)
208 views10 pages

Java Rmi - Case Study 1

JAVA RMI – CASE STUDY 1

Uploaded by

jitendra.s
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)
208 views10 pages

Java Rmi - Case Study 1

JAVA RMI – CASE STUDY 1

Uploaded by

jitendra.s
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/ 10

JAVA RMI – CASE STUDY

Remote Method Invocation (RMI) is an API that allows an object to invoke a method on an
object that exists in another address space, which could be on the same machine or on a
remote machine. Through RMI, an object running in a JVM present on a computer (Client-
side) can invoke methods on an object present in another JVM (Server-side). RMI creates a
public remote server object that enables client and server-side communications through
simple method calls on the server object.
Note
java.rmi package: Remote Method Invocation (RMI) has been

deprecated in Java 9 and later versions, in favor of other remote

communication mechanisms like web services or Remote Procedure Calls

(RPC).
Stub Object
Stub Object: The stub object on the client machine builds an
information block and sends this information to the server.

The block consists of

• An identifier of the remote object to be used


• Method name which is to be invoked
• Parameters to the remote JV
Skeleton Object
Skeleton Object: The skeleton object passes the request from the stub object to the
remote object. It performs the following tasks

It calls the desired method on the real object present on the server.
It forwards the parameters received from the stub object to the method
Working of RMI

The communication between client and server is handled by using two

intermediate objects: Stub object (on client side) and Skeleton object

(on server-side) as also can be depicted from below media as follows:


Working of RMI
Steps of the JAVA RMI-CASE STUDY
Step 1: Defining a remote interface

Step 2: Implementing the remote interface

Step 3: Creating Stub and Skeleton objects from the implementation class using rmic (RMI
compiler)

Step 4: Start the rmiregistry

Step 5: Create and execute the server application program

Step 6: Create and execute the client application program.


rmiregistry
rmiregistry refers to the RMI (Remote Method Invocation) registry, which is a part

of Java's RMI framework. It's a simple server-side bootstrap naming facility used by

RMI servers on the local host to bind exported objects to names. When an RMI

server is started, it needs to register its services (objects) with the rmiregistry so

that clients can look up and access these services.


Advantage of JAVA RMI
• Simplicity and Familiarity
• Seamless Integration with Java
• Automatic Object Serialization
• Interface Definition Language (IDL)
• Support for Callbacks
• Built-in Security Features
• Platform Independence
• Integration with Java EE
Disadvantages of JAVA RMI
• JAVA Centric
• Complex-configuration
• Performance Overhead
• Limited Scalability
• Firewal and NAT Traversal
• Security Constraints
• Dated Technology: Java RMI has become less popular over time as newer, more flexible, and
language-agnostic technologies like RESTful web services, gRPC, and message brokers have gained
popularity in the distributed computing landscape.

• Error Handling:Handling errors and exceptions in Java RMI can sometimes be challenging,
especially when dealing with network-related issues or remote method failures.

• Maintenance and Evolution

You might also like