CC5212-1 P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2016 Lab 2: Mensaje Aidan Hogan

Slides:



Advertisements
Similar presentations
COS 461 Fall 1997 Network Objects u first good implementation: DEC SRC Network Objects for Modula-3 u recent implementation: Java RMI (Remote Method Invocation)
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.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
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
CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2014 Aidan Hogan Lecture II: 2014/03/17.
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.
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)
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,
Lesson 3 Remote Method Invocation (RMI) Mixing RMI and sockets Rethinking out tic-tac-toe game.
FTP File Transfer Protocol. Introduction transfer file to/from remote host client/server model  client: side that initiates transfer (either to/from.
1 Java Programming II Java Network II (Distributed Objects in Java)
+ 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.
Labs 1.1: Mensaje. Step 1: Get Started Login: – Username: nombre/cc5212 – Password on board – C:/Program.
LAB 1CSIS04021 Briefing on Assignment One & RMI Programming February 13, 2007.
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.
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 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.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2015 Lecture 3: Distributed Systems II Aidan Hogan
 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.
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.
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.
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.
CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2016 Lecture 2: Distributed Systems I Aidan Hogan
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Java Distributed Computing
Chapter 4 Remote Method Invocation
Principles of Software Development
Aidan Hogan CC Procesamiento Masivo de Datos Otoño 2017 Lecture 2: Introduction to Distributed Systems Aidan Hogan
Java Distributed Computing
Java Remote Method Invocation (RMI)
Remote Method Invocation
What is RMI? Remote Method Invocation
Remote Method Invocation
Java Socket Programming and Java RMI CS
Network and Distributed Programming in Java
CC Procesamiento Masivo de Datos Otoño Lecture 2: Distributed Systems
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Creating a Distributed System with RMI
Chapter 40 Remote Method Invocation
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Creating a Distributed System with RMI
Creating a Distributed System with RMI
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
CC Procesamiento Masivo de Datos Otoño Lecture 2 Distributed Systems
Java Socket Programming and Java RMI CSE 291
Creating a Distributed System with RMI
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

CC P ROCESAMIENTO M ASIVO DE D ATOS O TOÑO 2016 Lab 2: Mensaje Aidan Hogan

Step 1: Get Started Login: – Username: nombre/cc5212 – Password on board Get code and import into Eclipse: – – File > Import > …

Step 2: Connect to Directory I start the directory! – Will put details on the board Connect … – org.mdp.cli.UserDirectoryClientApp

Step 3: Implement Message Server org.mdp.im.InstantMessagingServer – Implement InstantMessagingStub – Write message(.,.) method Print the message to the console and whom it’s from

Step 4: Implement Message App. org.mdp.cli.InstantMessagingApp Server (receive) Client (send)

Step 4a: Start Registry org.mdp.cli.InstantMessagingApp – Implement startRegistry(.) Server (receive) Registry (port) Client (send)

Step 4b: Register Skeleton org.mdp.cli.InstantMessagingApp – Implement bindSkeleton(.) – key = “ InstantMessagingServer ” Aka. InstantMessagingServer.class.getSimpleName(); – skeleton = new InstantMessagingServer() Server (receive) Registry (port) Client (send) keyskeleton

Step 4c: Implement Client org.mdp.cli.InstantMessagingApp – messageUser(.,.,.) – Connect to remote registry – Get the stub from the registry (same key) – Message user! Server (receive) Registry (port) Client (send) keyskeleton localhost YYY Directory

Step 4d: Find Peers w/ Directory org.mdp.cli.InstantMessagingApp – connectToDirectory() Server (receive) Registry (port) Client (send) keyskeleton localhost YYY Directory XXX

Step 4e: Setup Command Line Run InstantMessagingApp – With argument: -n [dir-location] Add yourself Message classmates!

JAVA RMI OVERVIEW

Why is Java RMI Important? We can use it to quickly build distributed systems using some standard Java skills.

What is Java RMI? RMI = Remote Method Invocation Remote Procedure Call (RPC) for Java Predecessor of CORBA (in Java) Stub / Skeleton model (TCP/IP) Client Stub Network Server Skeleton

What is Java RMI? Stub (Client): – Sends request to skeleton: marshalls/serialises and transfers arguments – Demarshalls/deserialises response and ends call Skeleton (Server): – Passes call from stub onto the server implementation – Passes the response back to the stub Client Stub Network Server Skeleton

Stub/Skeleton Same Interface! ClientServer

Server Implements Skeleton Server Synchronisation: (e.g., should use ConcurrentHashMap) [Thanks to Tomas Vera ] Problem?

Server Registry Server Registry Server (typically) has a Registry: a Map Adds skeleton implementations with key (a string) SkelImpl1“sk1” “sk2”SkelImpl2 “sk3”SkelImpl3

Server Creates/Connects to Registry OR Server

Server Registers Skeleton Implementation As a Stub Server

Registry Client Connecting to Registry Client connects to registry (port, hostname/IP)! Retrieves skeleton/stub with key Client Network SkelImpl1“sk1” “sk2”SkelImpl2 “sk3”SkelImpl3 “sk2” SkelImpl2 Stub2

Client Connecting to Registry Client

Server Client Calls Remote Methods Client has stub, calls method, serialises arguments Server does processing Server returns answer; client deserialises result Client Network SkelImpl2Stub2 concat (“a”,”b”) “ab”

Client Calls Remote Methods Client

Java RMI: Remember … 1.Remote calls are pass-by-value, not pass-by- reference (objects not modified directly) 2.Everything passed and returned must be Serialisable ( implement Serializable ) 3.Every stub/skel method must throw a remote exception ( throws RemoteException ) 4.Server implementation can only throw RemoteException