Remote Objects. The Situation Is there a better (in terms of programmer time) way to do network communications? What is it we’re trying to accomplish?

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.
COM vs. CORBA.
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Method Invocation (RMI) Mixing RMI and sockets
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
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
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:
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
Introduction to Remote Method Invocation (RMI)
Computer Science Lecture 2, page 1 CS677: Distributed OS Last Class: Introduction Distributed Systems – A collection of independent computers that appears.
Communication in Distributed Systems –Part 2
TENA Test and Training Enabling Architecture. TENA TENA is used in range environments, often in the L portion of LVC Slightly different emphasis; small.
Lesson 3 Remote Method Invocation (RMI) Mixing RMI and sockets Rethinking out tic-tac-toe game.
Common Object Request Broker Architecture CORBA. RMI is a simplified version of CORBA that does fairly well CORBA is all-singing and all-dancing Multiple.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics RPC & Middleware.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
Java Remote Method Invocation (RMI) ). Distributed Systems  a collection of independent computers that appears to its users as a single coherent system.
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.
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.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Distributed Computing A Programmer’s Perspective.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Java Programming: Advanced Topics 1 Networking Programming Chapter 11.
Common Object Request Broker Architecture (CORBA) The Common Object Request Broker Architecture (CORBA) is a specification of a standard architecture for.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Seminar on Service Oriented Architecture Distributed Systems Architectural Models From Coulouris, 5 th Ed. SOA Seminar Coulouris 5Ed.1.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Test Enabled and Training Architecture (TENA) Don McGregor Research Associate MOVES Institute
Remote Method Invocation A Client Server Approach.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
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 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Operating Systems {week 11a}
Java Distributed Computing
Last Class: Introduction
Client-Server Communication
Remote Method Invocation
What is RMI? Remote Method Invocation
Remote Method Invocation
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Chapter 40 Remote Method Invocation
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Chapter 46 Remote Method Invocation
Remote Procedure Call Hank Levy 1.
Chapter 46 Remote Method Invocation
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Remote Procedure Call Hank Levy 1.
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Remote Objects

The Situation Is there a better (in terms of programmer time) way to do network communications? What is it we’re trying to accomplish? Transmit data (position updates, etc) Cause some action to happen on the remote machine (Cannon fires, tank explodes, etc.) For the second case, implementations in sockets often look very similar

Remote Commands Receive Message Determine Msg type Call method in local VM space Return Results

Major Computer Science Insight Computers are good at doing repetitive things. Why not write a framework to automate this process? Lets make it appear that we’re directly calling methods on objects on remote machines Saves having to write all that nasty code every time we want to do a command implementation

Remote Objects The idea is that we make available some server object with methods. Clients get a reference to the server object, then call methods on that object. doSomething() public double doSometingB(int anArg) Proxy Object (client) doSomething() public double doSometingB(int anArg) Server Object (client)

Remote Objects To the programmer on the client side, the server object appears to be just another object. In reality it might be on the same machine, or halfway around the world. Generally you have a stand-in or a “proxy” for the server object that resides on the client host. The proxy has all the same methods as the server object, but only forwards the messages to the server object

Remote Objects This is a popular idea that dates back a ways, and there are many implementations Remote Procedure Call, RPC. Oriented towards procedural programming Remote Method Invocation, RMI. A java-only technique for calling methods on other machines; essentially stripped-down CORBA Common Object Request Broker Architecture, CORBA

Remote Objects We’ll be looking at RMI and a little about CORBA CORBA is cross-platform and multiple-language, and reasonably popular RMI is reasonably easy to understand On the other hand, RMI is Java-only

Remote Objects So what needs to be done? Usually we have a proxy object on the client side. This proxy is responsible for communicating with the “real” server object placing all the parameters into the right format to be sent across the wire Getting the response back Masquerading as the server object

What Could Go Wrong? RMI has some potential issues, mostly relating to it being too good at what it set out to do Objects programmers are used to are fast, highly reliable, and local. They can be tightly coupled with other objects to accomplish some task RMI makes remote objects look like local objects; but they’re not, in a fundamental way

What Could Go Wrong? Though RMI makes it appear that objects are local the the programmer in syntax, the reality is that the method calls are being made across the network. And compared to making method calls inside a virtual memory space, this is slow and unreliable. You can get away with making method calls in a tight loop for local objects; not so for remote objects You can more tightly couple objects in a local VM Don’t have to worry nearly as much about failed method calls Easy to pass large amounts of data between objects

What Could Go Wrong? From a syntax standpoint it looks like a local object, and that tempts you to use it in inappropriate ways Remember that remote objects should be very loosely coupled, and keep in mind their limitations

What Could Go Wrong? If you’re traversing firewalls in your calls you will have an uphill fight against security policies Scalability: TCP sockets, no provision for broadcast or multicast, etc.

Proxies The proxies are stand-ins for the real object on the server. They get the request locally, serialize all parameter data, send it across the wire via sockets, and get a response back To the user, it looks like a local object. In reality all the computation in the object is being done on the server side

RMI RMI uses an rmic compiler to create proxy objects from existing classes Design the class you want to act as a server Run it through RMIC Define a security policy Start up rmiregistry, which acts as a way for servers to register themselves as available Run client

Example RMI implementation of a card deck