Overview of RMI Architecture

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

Building Distributed Applications using JAVA - RMI
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
1 Chapter 9 Network Programming. 2 Overview Java has rich class libraries to support network programming at various levels. There are standard classes.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
Remote Method Invocation in Java Bennie Lewis EEL 6897.
Advanced Programming Rabie A. Ramadan Lecture 4. A Simple Use of Java Remote Method Invocation (RMI) 2.
Java Remote Method Invocation (RMI) In Java we implement object systems: O1O2 O3 thread 1thread 2 execution scheme JVM 1JVM 2 distribution scheme.
Remote Method Invocation
Company LOGO Remote Method Invocation Georgi Cholakov, Emil Doychev, University of Plovdiv “Paisii.
FONG CHAN SING (143334) WONG YEW JOON (143388). JAVA RMI is a distributive system programming interface introduced in JDK 1.1. A library that allows an.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
1 HANDOUT 14 Remote Method Invocation (RMI) BY GEORGE KOUTSOGIANNAKIS THIS DOCUMENT CAN NOT BE REPRODUCED OR DISTRIBUTED WITHOUT TH E WRITTEN PERMISSION.
EEC-681/781 Distributed Computing Systems Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Introduction to Remote Method Invocation (RMI)
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Java RMI Essentials Based on Mastering RMI Rickard Oberg.
RMI Components java.rmi: client-side RMI classes, interfaces, and exceptions java.rmi.server: server-side RMI classes, interfaces, and exceptions java.rmi.registry:
1 Java Programming II Java Network II (Distributed Objects in Java)
+ A Short Java RMI Tutorial Usman Saleem
Java RMI: Remote Method Invocation January 2000 Nancy McCracken Syracuse University.
Java Remote Method Invocation (RMI) ). Distributed Systems  a collection of independent computers that appears to its users as a single coherent system.
1 Java RMI G53ACC Chris Greenhalgh. 2 Contents l Java RMI overview l A Java RMI example –Overview –Walk-through l Implementation notes –Argument passing.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI RMI is the java API that facilitate distributed computing by allowing remote method calls. A remote method call represents a method invocation between.
Client Call Back Client Call Back is useful for multiple clients to keep up to date about changes on the server Example: One auction server and several.
Java Remote Method Invocation RMI. Idea If objects communicate with each other on one JVM why not do the same on several JVM’s? If objects communicate.
RMI Continued IS Outline  Review of RMI  Programming example.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Fall 2007cs4251 Distributed Computing Umar Kalim Dept. of Communication Systems Engineering 17/10/2007.
Java Remote Method Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Eric Tryon Brian Clark Christopher McKeowen. System Architecture The architecture can be broken down to three different basic layers Stub/skeleton layer.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
 Java RMI Distributed Systems IT332. Outline  Introduction to RMI  RMI Architecture  RMI Programming and a Sample Example:  Server-Side RMI programming.
Remote Method Invocation A Client Server Approach.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Remote Method Invocation RMI architecture stubs and skeletons for remote services RMI server and client in Java Creating an RMI Application step-by- step.
Java RMI. RMI Any object whose methods can be invoked from another Java VM is called a remote object.
Khoa CNTT 1/37 PHẠM VĂN TÍNH   Java RMI (Remote Method Invocation)
Java Distributed Object Model A remote object is one whose methods can be invoked from another JVM on a different host. It implements one or more remote.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Distributed programming in Java Faculty:Nguyen Ngoc Tu Session 5 - RMI.
CSC 480 Software Engineering Lab 6 – RMI Nov 8, 2002.
RMI1 Remote Method Invocation Adapted from “Core Java 2” by Cay Horstmann.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Java Distributed Computing
Java Distributed Object System
Java Distributed Computing
Java Remote Method Invocation (RMI)
RMI Packages Overview java.rmi java.rmi.server java.rmi.registry
Remote Method Invocation
Java RMI CS-328 Internet Programming.
What is RMI? Remote Method Invocation
Remote Method Invocation
Network and Distributed Programming in Java
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Chapter 40 Remote Method Invocation
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Overview of RMI Architecture
Remote Method Invocation
Chapter 46 Remote Method Invocation
Java Remote Method Invocation
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

Overview of RMI Architecture 10/14/2019 Peter Cappello

Introduction ... Remote methods have: much greater latency new failure modes Do not distribute that which does not need to be 10/14/2019

Introduction ... Remote method invocation is like local method invocation, except: Arguments & return values must: implement Serializable, or be Remote objects. Arguments & return values are passed by value. 10/14/2019

Other differences ... An RMI client refers to a remote object via a Remote interface (it may have many). The object methods: equals() hashCode(), toString() are overridden by java.rmi.RemoteObject. For example, the toString value includes transport info (network protocol, host name, & port number) 10/14/2019

Remote Object Structure To apply a remote method (y) to a remote object (x): x.y() x must be a reference to a remote object. The RMI client gets this reference: from a rmiregistry or as the return value of a prior remote method invocation 10/14/2019

Reference from Registry rmiregistry 2. Lookup service 1. Register service Client Server 3. Invoke method 10/14/2019

Remote Objects Implement the Remote Interface A remote object must implement at least 1 interface that extends the java.rmi.Remote interface. Only those methods declared in the interface can be invoked remotely. A diagram follows ... 10/14/2019

The Object Hierarchy Classes Interfaces java.lang.Object java.rmi.Remote java.rmi.server.RemoteObject java.rmi.server.RemoteServer java.rmi.server.UnicastRemoteObject YourRemoteInterface 10/14/2019 YourRemoteObject

RMI System Architecture RMI Client Application Layer RMI Server Stub Proxy Layer Skeleton Remote Reference Layer Transport Layer 10/14/2019

Application Layer No interface description language (IDL) The server application: Implements the remote interface that the client uses. Exports the object whose methods are invoked remotely (implicitly by extending UnicastRemoteObject) Registers itself with the rmiregistry. 10/14/2019

Application Layer ... The client application: Gets reference to remote object (o) Casts reference as remote interface (t) Applies methods (m) 10/14/2019

Proxy Layer: Stub The stub is the client’s proxy for the remote object. It: marshals arguments unmarshals returned values can be typed as any of the remote object’s remote interfaces 10/14/2019

Proxy Layer: Skeleton The skeleton is the server’s proxy for the remote object. It: Un-marshals arguments dispatches actual method marshals returned values 10/14/2019

Remote Reference Layer An abstraction between the proxy layer and the transport layer. It’s mostly reserved for future development: replicated objects persistent objects connection recovery 10/14/2019

Transport Layer This layer implements machine-to-machine communication. It defaults to TCP/IP. It can be overridden if you want to: encrypt streams compress streams perform other security & performance enhancements 10/14/2019

Name Service Remote object registers itself with name server: rmiregistry Clients get reference to remote object by looking up object’s reference in rmiregistry. There are 2 ways: 1 rmiregistry/machine for all applications on a well-known port. Application has its own rmiregistry on its own port. 10/14/2019

Garbage Collection A remote object can implement java.rmi.server.Unreferenced interface. Method unreferenced is invoked when the object is no longer referenced: You can do “clean up”. If network fails, an object may be wrongly collected. Referencing a non-existent object causes a RemoteException to be thrown. 10/14/2019

Class Loaders Class loaders dynamically load classes as needed. The RMIClassLoader loads the stub & skeleton classes, & any utility classes they need. For stub & skeleton classes, it looks in the directory named in the system property: java.rmi.server.codebase, set by the -D flag of the java interpreter. 10/14/2019

Security Eavesdropping: Secure Sockets Layer (SSL) can be used instead of TCP. Misbehaving code: RMI requires a security manager. Stand-alone applications set the security manager in main() . System.setSecurityManager(new RMISecurityManager()); prohibits stub classes from doing anything over the network except loading necessary classes. 10/14/2019

Performance RMI is simple to use. RMI is not as fast as local MI. RMI is not as fast as special-purpose communication protocols can be. RMI may not be efficient enough for high-performance real-time applications, such as video streaming. If you override TCP with a faster protocol, RMI may be fine. 10/14/2019

Summary: RMI Server To write an RMI server: Define interface that extends Remote. Define a class that extends UnicastRemoteObject & implements your remote interface. Its main(): Registers itself in the registry. 10/14/2019

Summary: RMI Client Execute System.setSecurityManager( new RMISecurityManager() ); Get a reference to the remote object by looking it up in rmiregistry. Apply methods as though it were local. Behind the scenes, object proxies, stubs & skeletons, are communicating. 10/14/2019