Remote Method Invocation in Java Bennie Lewis EEL 6897.

Slides:



Advertisements
Similar presentations
Building Distributed Applications using JAVA - RMI
Advertisements

What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
RMI Varun SainiYing Chen. What is RMI? RMI is the action of invoking a method of a remote interface on a remote object. It is used to develop applications.
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.
Java Remote Method Invocation (RMI) In Java we implement object systems: O1O2 O3 thread 1thread 2 execution scheme JVM 1JVM 2 distribution scheme.
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
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.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
EEC-681/781 Distributed Computing Systems Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
CSE331: Introduction to Networks and Security Lecture 11 Fall 2002.
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.
How Does Remote Method Invocation Work? –Systems that use RMI for communication typically are divided into two categories: clients and servers. A server.
Java RMI RMI = Remote Method Invocation. Allows Java programs to invoke methods of remote objects. Only between Java programs. Several versions (JDK-1.1,
CS603 Communication Mechanisms: DCE RPC (cont.) 23 January 2002.
Lesson 3 Remote Method Invocation (RMI) Mixing RMI and sockets Rethinking out tic-tac-toe game.
Java RMI Essentials Based on Mastering RMI Rickard Oberg.
1 Java Programming II Java Network II (Distributed Objects in Java)
CS 584 Lecture 18 l Assignment » Glenda assignment extended to the Java RMI Deadline » No Java RMI Assignment l Test » Friday, Saturday, Monday.
+ A Short Java RMI Tutorial Usman Saleem
15 - RMI. Java RMI Architecture Example Deployment RMI is a part of J2SE (standard edition), but is used by J2EE) A J2EE server is not nessesary for using.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
1 Classnote#12 RMI. 2 RMI applications are often comprised of two separate programs: – a server and a client. A typical server application –creates some.
Java RMI: Remote Method Invocation January 2000 Nancy McCracken Syracuse University.
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.
Presentation 18: RMI introduction. Goals of this lesson After this 35 min. lesson you will be: Introduced to Java RMI Ready to present RMI’s position.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
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.
Remote Method Invocation onlineTraining/rmi/RMI.html.
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.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
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.
Presentation: RMI introduction. Goals of this lesson After this 35 min. lesson you will be: Introduced to Java RMI Ready to present RMI’s position in.
Fall 2007cs4251 Distributed Computing Umar Kalim Dept. of Communication Systems Engineering 17/10/2007.
Li Tak Sing COMPS311F. RMI callbacks In previous example, only the client can initiate a communication with the server. The server can only response to.
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.
Presentation 11: RMI introduction. Ingeniørhøjskolen i Århus Slide 2 af 20 Goals of this lesson After these 2x35 lessons you will be –Introduced to Java.
Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Florida State UniversityCOP Advanced Unix Programming Remote Method Invocation /rmi/index.html.
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.
1 RMI Russell Johnston Communications II. 2 What is RMI? Remote Method Invocation.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
CSC 480 Software Engineering Lab 6 – RMI Nov 8, 2002.
RMI1 Remote Method Invocation Adapted from “Core Java 2” by Cay Horstmann.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
January 26, Ann Wollrath Copyright 1999 Sun Microsystems, Inc., all rights reserved. Java ™ RMI Overview Ann Wollrath Senior Staff Engineer Sun Microsystems,
Java Distributed Computing
Java Remote Method Invocation (RMI)
Remote Method Invocation
What is RMI? Remote Method Invocation
Remote Method Invocation
Java RMI (more) CS-328 Internet Programming.
Network and Distributed Programming in Java
Remote method invocation (RMI)
Overview of RMI Architecture
CS 584 Lecture 18 Assignment Glenda assignment extended to the Java RMI Deadline No Java RMI Assignment Test Friday, Saturday, Monday.
Java Remote Method Invocation
Overview of RMI Architecture
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

Remote Method Invocation in Java Bennie Lewis EEL 6897

AGENDA Introduction What is RMI The Goals of RMI The RMI system architecture How RMI works Distributed garbage collection Security Conclusion Questions

Introduction RMI Java’s RMI is an alternative to low level sockets. A remote method invocation is a form of the RPC that is available on other systems. Instead of creating objects on local machines you create some of the objects on other machines an you communicate with those objects as you would normally would with local objects

WHAT IS RMI RMI is a core package of the JDK 1.1 and above that can be used to develop distributed application. It enables software developers to write distributed applications in which the methods of remote objects can be invoked from other JVMs

The Goals of RMI Support seamless remote invocations on objects in different java virtual machines. Support callbacks from servers to clients. Integrate the distributed object model into the Java language in a natural way while retaining most of the Java language’s object semantics. Make differences between the distributed object model and the local java object model apparent. Make writing reliable distributed applications as simple as possible. Preserve the safety provided by the java sun real time environment.

The RMI system architecture The RMI system is built in three layers The stub/skeleton layer The remote reference layer The transport layer

The stub/skeleton layer The stub/skeleton layer is the interface between the application layer and he rest of the system. When a server application is developed. Stubs and skeletons are generated using the RMI’ rmic compiler, which generates proxy classes from the servers bytecodes The stub/skeleton layer transmits data to the remote reference layer via the abstraction of marshal streams which use objects serialization. Therefore. This layer does not deal with the specifics of any transport.

The remote reference layer The remote reference layer is a middle layer between the stub/skeleton layer and the transport layer. This layer is responsible for providing the ability to support varying remote reference or invocation protocols independent of the client stubs and server skeletons.

The Transport layer The transport layer is the low-layer that ships marshal streams between different address spaces. The transport layer is responsible for setting up connections to remote address spaces, managing connections, listening for incoming calls, maintaining a table of remote objects that reside in the same address space, setting up a connections to this dispatcher.

How RMI works When a client invokes an object implementation from the server the three layers of RMI come in the play. The most important layer to the programmer is the stub/skeleton layer. RMI comes with an rmic compiler that generates stubs and skeletons from user defined remote interfaces. Basically, stubs are client proxies and skeletons are server- side entities. Stubs will allow clients to communicate with the other layers of the system. This is done automatically as you will have to in inherit from RMI classes.

Example package RMI.hello; import java.rmi.Naming; import java.rmi.RemoteException; import java.rmi.RMISecurityManager; import java.rmi.server.UnicastRemoteObject; public class RMIserver extends UnicastRemoteObject implements Hello { public RMIserver() throws RemoteException { super(); } public String sayHello() { return "Bennie Lewis Hello World!"; } public static void main(String args[]) { if(System.getSecurityManager() == null) { System.setSecurityManager(new RMISecurityManager()); } try { RMIserver obj = new RMIserver(); Naming.rebind("//localhost/HelloServer",obj); System.out.println("HelloServer bound in registry"); } catch(Exception e) { System.out.println("RMIserver err: " + e.getMessage()); e.printStackTrace(); }

Example cont. package RMI.hello; import java.applet.Applet; import java.awt.Graphics; import java.rmi.Naming; import java.rmi.RemoteException; public class RMIclient extends Applet { String message = "blank"; Hello obj = null; public void init() { try { obj = (Hello)Naming.lookup("//" + getCodeBase().getHost() + "/HelloServer"); message = obj.sayHello(); } catch(Exception e) { System.out.println("HelloApplet exception:" + e.getMessage()); e.printStackTrace(); } public void paint(Graphics g) { g.drawString(message,25,50); }

Example cont. package RMI.hello; import java.rmi.Remote; import java.rmi.RemoteException; public interface Hello extends Remote { String sayHello() throws RemoteException; }

Distributed Garbage Collection When stand-alone applications are developed using java, objects that are no longer referenced by any client are automatically deleted. This is a desirable feature when developing distributed applications. The RMI system provides a distributed garbage collector that automatically deletes remote objects that are no longer referenced by any client.

Security There are a number of security issues that you should be aware of when developing mission-critical systems in RMI. There is no authentication; a client just requests and object (stub), and the server supplies it. Subsequent communication is assumed to b from the same client. There is no access control to the objects There are no security checks on the RMI registry itself; any caller Is allowed to make request. There is no version control between the stubs and the skeletons, making it possible for client to use a down-level stub to access a more recent skeleton breaking release-to- release binary compatibility

Conclusion RMI is an alternative to low level sockets RMI is a core package of the JDK 1.1 and above that can be used to develop distributed application. The RMI system is built in three layers The stub/skeleton layer, The remote reference layer, The transport layer

References Qusay H. Mahmoud,(1999). Distributed Programming with Java. Greenwich CT: Manning Publications Co. ndex.jsp

Questions