UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.

Slides:



Advertisements
Similar presentations
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
Advertisements

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.
1 Chapter 9 Network Programming. 2 Overview Java has rich class libraries to support network programming at various levels. There are standard classes.
Remote Method Invocation CS587x Lecture Department of Computer Science Iowa State University.
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.
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.
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
Remote Object Invocation Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
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.
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)
Algorithm Programming Distributed Programming in Java Bar-Ilan University תשס " ו by Moshe Fresko.
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.
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.
LAB 1CSIS04021 Briefing on Assignment One & RMI Programming February 13, 2007.
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.
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.
Silberschatz, Galvin, and Gagne  1999 Applied Operating System Concepts Chapter 15: Distributed Communication Sockets Remote Procedure Calls (RPCs) Remote.
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 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.
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.
Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
 Java RMI Distributed Systems IT332. Outline  Introduction to RMI  RMI Architecture  RMI Programming and a Sample Example:  Server-Side RMI programming.
Florida State UniversityCOP Advanced Unix Programming Remote Method Invocation /rmi/index.html.
Remote Method Invocation A Client Server Approach.
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)
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.
Netprog Java RMI1 Remote Method Invocation.
Using RMI The Example of A Remote Calculator 1. Parts of A Working RMI System A working RMI system is composed of several parts. –Interface definitions.
RMI1 Remote Method Invocation Adapted from “Core Java 2” by Cay Horstmann.
January 26, Ann Wollrath Copyright 1999 Sun Microsystems, Inc., all rights reserved. Java ™ RMI Overview Ann Wollrath Senior Staff Engineer Sun Microsystems,
Java Remote Method Invocation (RMI)
Remote Method Invocation
What is RMI? Remote Method Invocation
Remote Method Invocation
Advanced Remote Method Invocations
Java RMI (more) CS-328 Internet Programming.
Network and Distributed Programming in Java
Creating a Distributed System with RMI
Creating a Distributed System with RMI
Remote Method Invocation
Creating a Distributed System with RMI
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
Creating a Distributed System with RMI
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick

UMBC 2 Remote Method Invocation RMI JAVA-TO-JAVA Object running on one JVM can invoke methods on an object running on another JVM RMI provides communication between remote Java programs

UMBC 3 Overview Sever Creates Remote Objects Server Makes References to Them Accessible Server Waits on Remote Method Calls Client get References to Remote Objects Invokes Methods on Them Distributed Objects

UMBC 4 Distributed Objects Locate Remote Objects –Register –Pass and Return References Communicate with Remote Objects (Transparent to Programmer) Load Bytecode and transmit data over network

UMBC 5 Dynamic Code Loading Download code of an objects class if class not defined in receiver’s virtual machine RMI passes objects by true type Change behavior of application dynamically Compute Example

UMBC 6 Remote Interfaces, Objects, and Methods Distrubed application made up of interfaces and classes Some implementations reside on remote machines Objects with methods on remote VM’s are remote objects Object is remote by implementing remote interface

UMBC 7 Remote Interfaces Extends java.rmi.Remote Each remote method must declare java.rmi.RemoteException Remote objects are passed by reference between virtual machines, not a copy

UMBC 8 Stubs Remote reference is a stub Local representative or proxy Caller invokes method on stub which carries out method call on remote object Stub implements the same set of remote interfaces as remote object Only those methods defined in remote interface available to caller

UMBC 9 Steps Design and Implement Components of Distributed Application Compile Sources and Generate Stubs and Skeletons Make Classes Network Accessible Start the Application

UMBC 10 Details Object becomes remote by implementing a remote interface java.rmi.Remote Methods java.rmi.RemoteException in throws clause Stub is local proxy for remote object. Generated by rmic compiler Skeleton interfaces object and object manager on Server

UMBC 11 Details, contd. Define Remote Interface: specifies remote methods Implement Remote Objects: Implement the remote interface Implement Clients Put classes in Web accessible directory: remote interfaces, stubs, other download classes Start registry, start application

UMBC 12 Example Generic Compute Engine What it computes is not defined when engine is written Take advantage of central powerful machine Dynamic

UMBC 13 An Example

UMBC 14 How it works

UMBC 15 Interface Details Compute allows jobs to be submitted to the engine Task defines how the compute engine executes the given task. Passed by value between VM’s Return value is an Object

Example 16

UMBC 17 Implementing a Remote Interface Declare remote interfaces Define constructor for Remote object Provide implementations for remote methods Create and install security manager create instance of remote object register remote object with registry

UMBC 18 UnicastRemoteObject : Point to point communications with socket transport. Constructor exports object for calls. RMISecurityManager as restrictive as Applet Create instance and bind to registry. Instance is of type Compute. Name is host where registry is. UnicastRemoteObject

UMBC 19 Register Front-end for binding (registering) and looking up remote object is java.rmi.Naming interface Remote VM’s can look up objects by name in RMI registry. Name should inlcude name of host where registry and remote object run, and a name that identifies remote object in registry.

UMBC 20 Bind remote object to registry URL type format for host and name Default port is 1099 rmi::/ : /Compute RMI runtime substitutes reference to stub for remote object reference. Remote object implementations never leave JVM where created. RMI keeps ComputeEngine running Binding

UMBC 21 Stubs When client invokes remote method, it actually calls a regular method on a local JVM. This method is encapsulate in a stub class (surrogate) Stub encodes parameters (marshalling) Sends information over network to server

UMBC 22 Skeleton Makes sense out of information in packet from stub (Unmarshals) Passes it to actual object on local JVM Packages response and sends it back to client Stubs can be on local machine or loaded across network similar to applet

UMBC 23 Client Stub Skeleton Server Method Invocation Marshalled Parameters and Return Values Marshalling

The Server import java.rmi.*; import java.rmi.server.*; import java.net.*; public class HelloServer extends UnicastRemoteObject implements IHello { public HelloServer() throws RemoteException { hiMsg = "Hello, world!"; } public String sayHi() throws RemoteException { return hiMsg; } public static void main( String[ ] args ) { try { Naming.rebind( "hello", new HelloServer() ); } catch( RemoteException e ) { System.err.println( e ); } catch( MalformedURLException e ) { System.err.println( e ); } } private String hiMsg; } UMBC

25 The Client import java.rmi.*; public class HelloClient { public static void main( String[ ] args ) { System.setSecurityManager( new RMISecurityManager() ); try { IHello iface = (IHello) Naming.lookup( "rmi:// /hello" ); System.out.println( "Client says " + iface.sayHi() ); } catch( Exception e ) { System.err.println( e ); } }

UMBC 26 Connecting Client to Server javac HelloServer.java HelloClient.java rmic HelloServer Rmiregistry & java –Djava.security.policy= HelloServer & java –Djava.security.policy= HelloClient

UMBC 27 A Policy File grant { // Allow everything for now permission java.security.AllPermission; };

UMBC 28 Client Defines task to be done by ComputeEngine

Example

UMBC 31 Running the Example Pi class downloaded to server at runtime ComputeEngine stub downloaded to client at runtime Make jar file with compute package (interfaces) Distribute to developers Put classes in network accessible directory

UMBC 32 RMI uses URL protocols to download code Classpath should include location of jar files and source files Compile source ( javac ), generate stub ( rmic ) Source for the example discussed so far can be found in the Java Tutorial on RMIJava Tutorial on RMI Using RMI

UMBC 33 Selected References Advanced Techniques for Java Developers Chapter 7 Exploring Java, O’Reilly, Niemeyer & Peck Java RMI Remote Method Invocation, Troy Downing, IDG Books The RMI example comes from Core Web Programming, Marty Hall, Prentice Hall