Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Advance Java programming

Rating
-
Sold
-
Pages
14
Uploaded on
14-03-2024
Written in
2023/2024

"Advance Java programming" refers to the practice of utilizing advanced concepts and features of the Java programming language to develop complex and sophisticated applications. This includes topics such as multithreading, networking, database connectivity, GUI programming, web development, and more. Advanced Java programmers have a deep understanding of Java fundamentals and are able to leverage advanced techniques to build robust and efficient software solutions. By mastering advanced Java programming, developers can create high-performance applications that meet the demands of modern software development.

Show more Read less
Institution
Course

Content preview

Unit 8: RMI and CORBA (3 Hrs.)
Introduction of RMI:

RMI stands for Remote Method Invocation. It is a mechanism that allows an object residing in
one system (JVM) to access/invoke an object running on another JVM. RMI is used to build
distributed applications; it provides remote communication between Java programs. It is
provided in the package java.rmi.

Remote Method Invocation (RMI) is an application programming interface (API) in
the Java programming language and development environment. It allows objects on one
computer or Java Virtual Machine (JVM) to interact with objects running on a different JVM in a
distributed network. Another way to say this is that RMI provides a way to create distributed
Java applications through simple method calls.


RMI Architecture:
In an RMI application, we write two programs, a server program (resides on the server) and
a client program (resides on the client).
 Inside the server program, a remote object is created and reference of that object is made
available for the client (using the registry).
The client program requests the remote objects on the server and tries to invoke its
methods.
The RMI architecture consists of four layers:




Notes by Santosh Bhatt Page 1

, 1. Application Layer: This layer is the actual systems i.e. client and server which are involved
in communication. The java program on the client side communicates with the java program on
the server-side.
2. Proxy Layer: This layer contains the client stub and server skeleton objects.
 Stub is an object that resides on the client machine and it acts as a proxy for the remote
object. It is like a gateway for the client program. When the client calls on the stub
object, the stub forwards this request to a remote object (Skeleton) via RMI
infrastructure which is then executed on the server.
 The server object which resides in a server machine is known as Skeleton. Stub
communicates with server application with the help of an intermediate Skeleton object.
The responsibility of the skeleton object is to send parameters to method implementation
and send the return values back to the client.
3. Remote Reference Layer: This layer is responsible to maintain the session during the method
call. i.e. It manages the references made by the client to the remote server object. This layer is
also responsible for handling duplicated objects. The invocation semantics of the RMI
connection is defined and supported by this layer.
4. Transport Layer: The transport layer is responsible for setting up communication between
the two machines. This layer uses standard TCP/IP protocol for connection. The actual
transportation of data is performed through this layer.

Steps of Writing RMI Programs:
Below is the 6 - six steps to write the RMI program in java.

 Creation of remote interface
 Provide the implementation of the remote interface
 Compile the implementation class and create the stub and skeleton objects using the rmic
tool
 Start the registry service by rmi registry tool
 Write and start the remote application
 Write and start the client application

1. First Define the java remote interface

First thing to do is create an interface to describe the techniques that can be invoked by distant
clients. This interface should extend the Remote interface and throw the RemoteException inside
the interface using the method prototype.
// Creating a Search interface
import java.rmi.*;
public interface MySearch extends Remote
{
// Declaring the method prototype

Notes by Santosh Bhatt Page 2

Written for

Institution
Course

Document information

Uploaded on
March 14, 2024
Number of pages
14
Written in
2023/2024
Type
Class notes
Professor(s)
Santosh bhatt
Contains
All classes

Subjects

$10.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
santoshbhatt

Get to know the seller

Seller avatar
santoshbhatt SNSC
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions