RMI Continued IS 313 5.29.2003. Outline  Review of RMI  Programming example.

Slides:



Advertisements
Similar presentations
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.
Advertisements

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.
DISTRIBUTED FILE SYSTEM USING RMI
Advanced Java Class Network Programming. Network Protocols Overview Levels of Abstraction –HTTP protocol: spoken by Web Servers and Web Clients –TCP/IP:
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.
How Does Remote Method Invocation Work? –Systems that use RMI for communication typically are divided into two categories: clients and servers. A server.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Java RMI RMI = Remote Method Invocation. Allows Java programs to invoke methods of remote objects. Only between Java programs. Several versions (JDK-1.1,
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)
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
ICS 123 Java RMI ICS 123 Richard N. Taylor and Eric M. Dashofy* UC Irvine * with the usual thanks to David Rosenblum.
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.
Sun’s Jini Lab 2 Service Registration Client Lookup.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
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.
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 Distributed Object-based System and RPC Together 2-Jun-16.
 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.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Java RMI. RMI Any object whose methods can be invoked from another Java VM is called a remote object.
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.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Java Distributed Computing
Principles of Software Development
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.
Remote Method Invocation
Java RMI (more) CS-328 Internet Programming.
Creating a Distributed System with RMI
Chapter 40 Remote Method Invocation
Creating a Distributed System with RMI
Overview of RMI Architecture
Remote Method Invocation
Creating a Distributed System with RMI
Chapter 46 Remote Method Invocation
Using RMI -The Example of A Remote Calculator
Chapter 46 Remote Method Invocation
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
Overview of RMI Architecture
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

RMI Continued IS

Outline  Review of RMI  Programming example

RMI  Remote interface  Remote object  Registry  Server  Client  RMI compilation

Remote Interface  Service What a client wants from the server  Remote Interface Define a Java interface for the service Must extend java.rmi.Remote All methods must throw java.rmi.RemoteException

Example public interface IFFService extends java.rmi.Remote { public List findByName (String firstName, String lastName) throws RemoteException; public List findByLevel (int level) throws RemoteException;... etc... }

Remote object  Remote object implements remote interface usually extends java.rmi.server.UnicastRemoteObject constructor must throws RemoteException

Example public class FFRMIMode extends UnicastRemoteObject implements IReservationServer { public FFRMIMode () throws RemoteException {... } public List findByName (String firstName, String lastName) throws RemoteException {... }... etc... }

Registry  Must be running for objects to be registered and looked up rmiregistry [port] default port is 1099

Server  Creates remote object  Registers (names) it via the registry  Example String name = “FrequentFlyer"; try { Naming.rebind (name, new FFRMIMode ()); } catch (RemoteException e) {... }... also must catch MalformedURLException and AccessException..

Client  Looks up the relevant remote object  Executes its methods

Example try { String rmiUrl = "//" + host + "/FrequentFlyer"; IFFServer server = (IFFServer) Naming.lookup (rmiUrl); List members = server.findByName (“Marilyn”, “Monroe”); }... exception handling omitted...

Serialization  Turning Java data into stream data  Can be written to a file to a data stream as an RMI argument or return value  All primitive types not all objects

RMI at Compile Time

RMI at Run Time

Example  So far remote interface remote object  Need server to register client to use

Execution  Run registry  Run server  Run client

Distribution  Client programmers need Remote interface and associated classes  Executing clients need Stub class Serializable classes

Full distribution  Send.java Remote interface  Send.class Serializable classes stub class

Minimal distribution  Send.java Remote interface  Client app requests needed class files at run time uses HTTP if available can use registry also

Activation  Problem Need to have server program running Server program  creates object  registers object  provides execution environment (JVM)

Remote Activation 1. Register object without creating it 2. When client requests object  create a JVM  instantiate the object

Differences  java.rmi.activation.Activatable instead of UnicastRemoteObject  Run rmid as well as registry  Register ActivationDescriptor with rmid

Example