Rmi architecture

1,347 views 17 slides Jan 20, 2016
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17

About This Presentation

Java Remote Method Invocation Architecture


Slide Content

RMI ARCHITECTURE Group Members: Rushikesh B osamia-130080116003 Maulik Desai-130080116009 Dhruvi Doshi-130080116011 Eva Khakhkhar -130080116012 5th sem BVM IT DEPT Guided by: Prof Vatsal Shah

WHAT IS RMI? Java Remote Method Invocation is a mechanism for invoking methods of remote objects. It facilitates communications of data as well as invoke methods in a remote objects among distributed objects.

LOCAL V/S REMOTE OBJECTS invocation invocation remote invocation remote local local local invocation invocation A B C D E F

RMI REGISTRY RMI registry provides the registry services for the server to register the object and for the client to locate the object.

RMI REGISTRY:BINDING OBJECTS

RMI ARCHITECTURE

7 How does RMI work? A subinterface of java.rmi.Remote that defines the methods for the server object . A utility that registers remote objects and provides naming services for locating objects. An instance of the server object interface. A program that invokes the methods in the remote server object. An object that resides on the client host and serves as a surrogate for the remote server object. An object that resides on the server host, communicates with the stub and the actual server object. RMI works as follows: (1) A server object is registered with the RMI registry; (2) A client looks through the RMI registry for the remote object; (3) Once the remote object is located, its stub is returned in the client; (4) The remote object can be used in the same way as a local object. The communication between the client and the server is handled through the stub and skeleton.

HOW TO CREATE AN RMI APPLICATION?

Step 1: Define Server Object Interface public interface ServerInterface extends Remote { public void service1 (..)throws RemoteException ; // Other methods } A server object interface must extend the java.rmi.Remote .

Step 2: Define Server Implementation Object public class ServerInterfaceImpl extends UnicastRemoteObject implements ServerInterface { public void service1(...) throws RemoteException { // Implement it } // Implement other methods } The server implementation class must extend the java.rmi.server.UnicastRemoteObject class.

Step 3: Create and Register Server Object     Create a server object from the server implementation class and register it with an RMI registry:   Naming.rebind (" RemoteObjectName ", obj );

Step 4: Develop Client Program Develop a client that locates a remote object and invokes its methods :   ServerInterface server = ( ServerInterfaceImpl ) N aming.lookup (" RemoteObjectName "); server.service1(...);

Interface

Implementation

SERVER PROGRAM

CLIENT PROGRM

THANK YOU
Tags