Distributed Objects Exercises in. Overview Interface Exercises How does an Object Reference look? How long can/should a client store one? How do you tell.

Slides:



Advertisements
Similar presentations
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
Advertisements

One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server.
Distributed Service Architectures Yitao Duan 03/19/2002.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
Integration case study Week 8 – Lecture 1. Enrolment request (Workstation) Application server Database server Database New University Student Record System.
Communication in Distributed Systems –Part 2
Lesson 3 Remote Method Invocation (RMI) Mixing RMI and sockets Rethinking out tic-tac-toe game.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The Proxy Design Pattern (1) –A structural design pattern.
Proxy Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Client/Server Software Architectures Yonglei Tao.
Distributed File Systems Concepts & Overview. Goals and Criteria Goal: present to a user a coherent, efficient, and manageable system for long-term data.
Module 12: Designing an AD LDS Implementation. AD LDS Usage AD LDS is most commonly used as a solution to the following requirements: Providing an LDAP-based.
RMI Components java.rmi: client-side RMI classes, interfaces, and exceptions java.rmi.server: server-side RMI classes, interfaces, and exceptions java.rmi.registry:
Socket based Client/Server Systems Exercises in. Exercises Build a generic client Build an echo server Build a http client and server Build a proxy/firewall.
DNA REASSEMBLY Using Javaspace Sung-Ho Maeung Laura Neureuter.
CS425 /CSE424/ECE428 – Distributed Systems – Fall Nikita Borisov - UIUC1 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 4 Communication.
DISTRIBUTED COMPONENT OBJECT MODEL - A STUDY OF ITS ARCHITECTURE AND WHY IT IS CONSIDERED A FAILURE BY EXPERTS.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Distributed Objects Lecture on Prof. Walter Kriha, HdM Stuttgart.
In the name of Allah The Proxy Pattern Elham moazzen.
Client Call Back Client Call Back is useful for multiple clients to keep up to date about changes on the server Example: One auction server and several.
RMI Continued IS Outline  Review of RMI  Programming example.
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.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
CORBA Common Object Request Broker Architecture. Basic Architecture A distributed objects architecture. Logically, an object client makes method calls.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Proxy.
Presentation 3: Designing Distributed Objects. Ingeniørhøjskolen i Århus Slide 2 af 14 Outline Assumed students are knowledgeable about OOP principles.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
Some Ideas for a Revised Requirement List Dirk Duellmann.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 2, 3: Communication 1/30/20161Distributed Systems - COMP 655.
Proxy Pattern. What’s a Proxy? A remote proxy acts as a local representative of a remote object Remote Object: instantiated in a different JVM heap (a.
Remote Method Invocation RMI architecture stubs and skeletons for remote services RMI server and client in Java Creating an RMI Application step-by- step.
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
ZOOKEEPER. CONTENTS ZooKeeper Overview ZooKeeper Basics ZooKeeper Architecture Getting Started with ZooKeeper.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Java Distributed Object System
Distributed Computing
Apartments and COM Threading Models
Java Distributed Computing
CORBA Alegria Baquero.
Extending Java RMI for Dynamic Reconfiguration
Out-of-Process Components
Programming Models for Distributed Application
CORBA Alegria Baquero.
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
Remote Method Invocation
Creating a Distributed System with RMI
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
Lecture 6: RPC (exercises/questions)
Out-of-Process Components
Software Design Lecture : 38.
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
Creating a Distributed System with RMI
More concurrency issues
Presentation transcript:

Distributed Objects Exercises in

Overview Interface Exercises How does an Object Reference look? How long can/should a client store one? How do you tell an idle client from a crashed client? What happens if you downloaded a stub to a client and the implementation gets changed afterwards? Why is activation so important? (think about state on the server) Design problem: Singleton proxy Load Balancing with CORBA IOR’s? With RMI OR’s? Exercises with Java RMI: a remote bank Your project status

Interface Exercises (1) Interface Address { setStreet(String); setHouseNumber(String); setCity(String); set ZipCode(String); } Is this interface design problematic? When?

Interface Exercises (1) If two clients would use an instance of such a remote object concurrently (like e.g. one trying to read everything while the other one tries to perform a change of address there is a high chance of the reader to read inconsistent data. How would a server instantiate such an object? Would it create an empty object and hope that the client will fill everything in?

Interface Exercises (2) Interface Foo { init(); doIt(String); reset(); } Is this interface design understandable? Problems?

Interface Exercises (2) Init() : this is an example of the “half-baked-object” anti- pattern. An object is created only by half and then returned to an unsuspecting client – which will hopefully perform the rest of the initialization by calling init(); init(), doIt(), reset(): what is the order of usage here? After calling doIt(), do I need to call reset()? Or after calling reset(), do I need to do init() again?

How long can you store an IOR? Since the IOR contains a host and port combination it will be invalidated if host/port changes If the IOR would contain longer lasting keys (like foreign keys in a database, then a mechanism could be defined that would reconnect to the proper remote object even if the servant changed to a different host.

Why is activation so important? client Servant Passivate() Activate() persitent storage Servant Passivate() Activate() Servant Passivate() Activate() Servant Passivate() Activate() Servant Passivate() Activate() If a server can transparently store servant state on persistent storage and re-create the servant on demand, then it is able to control its resources against memory exhaustion and performane degradation.

Implementation changes: consequences In RMI you will need to restart the registry. This invalidates all outstanding remote object references from this registry. You will need to restart the clients too.

A remote bank (Flanagan example) -Look at the method implementations: Why do some methods have a “synchronized” outside AND inside? - Make a performance guess: how many clients will the server be able to serve? What are the problems?

A remote bank (Flanagan example) - synchronized twice? Yes, the first one locks the method against concurrent access, the second one an internally used object (member) of the class. The last one locks the object against all calls that do a synchronize (object). - The most methods are synchronized from the outside. Inside (meaning inside a synchronized area) they perform some operations (like allocations) that should happen outside. - If there is only one server object for this bank there will be a performance problem because of over- synchronization.

Resources The remote bank example from David Flanagan’s Java by Example