Distributed Programming in Java

Similar documents
Screen Saver Science: Realizing Distributed Parallel Computing with Jini and JavaSpaces

JavaSpaces technology for distributed communication and collaboration. Chih-Yao Hsieh

Using JavaSpaces to create adaptive distributed systems

Middleware-Konzepte. Tuple Spaces. Dr. Gero Mühl

MS Project Proposal. Tuple Board

A Performance Evaluation of Distributed Algorithms on Shared Memory and Message Passing Middleware Platforms

Loosely Coupled Communication and Coordination in Next- Generation Java Middleware by Bernhard Angerer and Andreas Erlacher 06/03/2005

Ubiquitous Computing Summer Supporting distributed applications. Distributed Application. Operating System. Computer Computer Computer.

The Zero-Delay Data Warehouse: Mobilizing Heterogeneous Databases

CA341 - Comparative Programming Languages

Linda, FT-Linda, and Jini

Agent Space Architecture for Search Engines

Linda, JavaSpaces & Jini

Page 1. CS 194: Distributed Systems Distributed Coordination-based Systems. Coordination Systems. Taxonomy of Coordination Models

DS 2009: middleware. David Evans

The Jini architecture. Johan Petrini and Henning Sundvall

Electronic Payment Systems (1) E-cash

Distributed Middleware. Distributed Objects

Trading Services for Distributed Enterprise Communications. Dr. Jean-Claude Franchitti. Presentation Agenda

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

New and Improved: Linda in Java

Jini Technology Overview

Page 1. Extreme Java G Session 8 - Sub-Topic 2 OMA Trading Services

JavaSpaces Specification

Distributed Systems/Middleware JavaSpaces

Time and Space. Indirect communication. Time and space uncoupling. indirect communication

Communication Paradigms

Distributed Object Space Cluster Architecture for Search Engines

Today: More Case Studies DCOM

Indirect Communication

Chapter 2 Architectures. Software Architectures

Indirect Communication

An Introduction to Software Architecture By David Garlan & Mary Shaw 94

02 - Distributed Systems

02 - Distributed Systems

PerlDSM: A Distributed Shared Memory System for Perl

Jini Connection Technology Architecture Overview

PerlDSM: A Distributed Shared Memory System for Perl

Structured communication (Remote invocation)

Indirect Communication

DISTRIBUTED COMPUTER SYSTEMS ARCHITECTURES

CAS 703 Software Design

Tuple board: a new distributed computing paradigm for mobile ad hoc networks

LINDA. The eval operation resembles out, except that it creates an active tuple. For example, if fcn is a function, then

Distributed Systems Course. a.o. Univ.-Prof. Dr. Harald Kosch

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

T NAF: Jini & EJB

DISTRIBUTED SYSTEMS [COMP9243] Distributed Object based: Lecture 7: Middleware. Slide 1. Slide 3. Message-oriented: MIDDLEWARE

Distributed Systems Question Bank UNIT 1 Chapter 1 1. Define distributed systems. What are the significant issues of the distributed systems?

COMP 4905 Honours Project Winter RSpace : A Tuple Space Implementation Using RESTful Web Services

A Tutorial on The Jini Technology

CABRI, LETIZIA LEONARDI, AND FRANCO ZAMBONELLI

An Introduction to Software Architecture. David Garlan & Mary Shaw 94

one.world Towards a System Architecture for Pervasive Computing

Adaptive Cluster Computing using JavaSpaces

Coordination Patterns

Performance Evaluation of Java And C++ Distributed Applications In A CORBA Environment

MOBISPACE: A DISTRIBUTED TUPLESPACE FOR J2ME ENVIRONMENTS

A Framework for Opportunistic Cluster Computing using JavaSpaces 1

CPE731 Distributed System Models

Troubleshooting Jini Configuration Problems

Inter-process communication (IPC)

Mobile Computing (3C05) Outline. Introduction

Two Phase Commit Protocol. Distributed Systems. Remote Procedure Calls (RPC) Network & Distributed Operating Systems. Network OS.

Unit 7: RPC and Indirect Communication

Jarcler: Aspect-Oriented Middleware for Distributed Software in Java

Service Provision in Ad Hoc Networks

Scaling Tuple-Space Communication in the Distributive Interoperable Executive Library. Jason Coan, Zaire Ali, David White and Kwai Wong

INTRODUCTION TO Object Oriented Systems BHUSHAN JADHAV

Computer and Automation Research Institute Hungarian Academy of Sciences. Jini and the Grid. P. Kacsuk

Using Space-Based Computing for More Efficient Group Coordination and Monitoring in an Event-Based Work Management System

Message Passing vs. Distributed Objects. 5/15/2009 Distributed Computing, M. L. Liu 1

CALIFORNIA SOFTWARE LABS

Cpt. S 464/564 Lecture Auxiliary Material (not from text) January 29-31, Middleware in Context: 2016 David E. Bakken

Interconnection of Distributed Components: An Overview of Current Middleware Solutions *

Announcements. me your survey: See the Announcements page. Today. Reading. Take a break around 10:15am. Ack: Some figures are from Coulouris

Overview. Communication types and role of Middleware Remote Procedure Call (RPC) Message Oriented Communication Multicasting 2/36

CHAPTER 2. Introduction to Middleware Technologies

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Introduction to Distributed Systems. Fabienne Boyer, LIG,

Lecture 8. Linda and Erlang

ADVANCED SOFTWARE DESIGN LECTURE 4 SOFTWARE ARCHITECTURE

Object-Oriented Design

PARALLEL PROGRAM EXECUTION SUPPORT IN THE JGRID SYSTEM

9. Distributed Shared Memory

About a Framework for Integrating Smart Devices in Java Applications

Distributed Automation System based on Java and Web Services

Distributed Systems. Lehrstuhl für Informatik IV RWTH Aachen. Organisation. Classification of the lecture. Literature

Distribution and web services

Reference: Java Web Services Architecture James McGovern, Sameer Tyagi, Michael Stevens, and Sunil Mathew, 2003

Client/Server-Architecture

Middleware-Integration of Small Devices

Introduction. Chapter 1

PADI Plataformas e Aplicações Distribuídas na Internet

Chapter 20 Tuple Space

Lecture 5: Object Interaction: RMI and RPC

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN

Object-Oriented Design

Embedded Device Cooperative System Using Java Bytecode Instrumentation

Chapter 1 Coordination Mechanisms in Complex Software Systems

Transcription:

Distributed Programming in Java Distribution (5) RPC-style middleware Disadvantages: Strongly coupled Synchronous Limited extensibility Advantages: Transparency. Type safety 2/24 Space-based middleware Based upon tuple spaces A tuple space is an implementation of the associative memory paradigm for parallel/distributed computing. It provides a repository of tuples that can be accessed concurrently. Producers post their data as tuples in the space, and the consumers then retrieve data from the space that match a certain pattern. This is also known as the Blackboard metaphor. Tuple spaces were the theoretical underpinning of the Linda language developed by David Gelernter and Nicholas Carriero at Yale University. 3/24 1

Space-based Design Requires design of distributed data structures and distributed protocols that operate over them. Distributed data structure is made up of multiple objects stored in one or more spaces. E.g., ordered list of items represented by a set of objects, each of which holds the value and position of a single list item. Using collection of objects in shared space allows multiple processes to concurrently access and modify the data structure. 4/24 JavaSpaces I JavaSpaces is a service specification providing a distributed object exchange and coordination mechanism (which may or may not be persistent) for Java objects. It can be used to store the system state and implement distributed algorithms. In a JavaSpace all communication partners (peers) communicate by sharing state. Using JavaSpaces, distributed applications are modeled as a flow of objects between participants, which is different from classic distributed models such as RMI. 5/24 JavaSpaces II Achieves scalability through parallel processing Provides for reliable storage of objects while reducing the complexity of traditional distributed systems. Processes perform simple operations: Write new objects into a JavaSpace, Take objects from a JavaSpace, or Make copies of objects the JavaSpace. JavaSpaces is part of Jini technology 6/24 2

JavaSpaces Architecture 7/24 Coordination 8/24 JavaSpace Services and Operations Application components (or processes) use the persistent storage of a space to store objects and to communicate. The components coordinate actions by exchanging objects through spaces; the objects do not communicate directly. Processes interact with a space through a simple set of operations 9/24 3

JavaSpace Primary Operations write(): Writes new objects into a space take(): Retrieves objects from a space read(): Makes a copy of objects in a space notify(): Notifies a specified object when entries that match the given template are written into a space 10/24 JavaSpaces Technology Application Model JavaSpaces service holds entries, each of which is a typed group of objects expressed in a class that implements the interface net.jini.core.entry.entry. Once an entry is written into a JavaSpaces service, it can be used in future look-up operations. Looking up entries is performed using templates, which are entry objects that have some or all of their fields set to specified values that must be matched exactly. All remaining fields, which are not used in the lookup, are left as wildcards. 11/24 JavaSpace Entry Details Entries in a JavaSpace are simple Java Objects that follow a few simple rules: All data persisted in the space must be exposed in public fields. The Entry interface must be implemented. This is a marker interface, requiring no methods to conform to the interface contract Objects must be used for the properties (i.e., no primitive fields.) 12/24 4

Simple Server Example Fields must be public 13/24 Simple Client Example 14/24 JavaSpaces Technology Application 15/24 5

JavaSpaces: Multi-user Chat System All the messages that make up the discussion are written to a space that acts as a chat area. Participants write message objects into the space, while other members wait for new message objects to appear, then read them out and display their contents. The list of participants can be kept in the space and updated whenever someone joins or leaves the discussion. Because the space is persistent, a new member can read and view the entire discussion. 16/24 Discussion: Advantages You can implement such a multi-user chat system in RMI by creating remote interfaces for the interactions discussed. Using JavaSpaces technology, you need only one interface 17/24 Multi-user Chat: The Message 18/24 6

Multi-user Chat: Writing the Message Leases can be shorter: e.g. 60*60*1000 ms 19/24 Multi-user Chat: Reading the Message -- Template has null fields -- act as wildcards -- Read will match any MessageEntry -- Will block if no MessageEntry -- Can use readifexists( ) to avoid blocking 20/24 The Full Client Code to find JavaSpace service (see course page) 21/24 7

Using JavaSpaces Download jini distribution (www.jini.org) Create subclasses of Entry for your application tuple(s) Compile including jini-ext.jar in classpath. Run Launch-All from installverify directory Select Register and choose IP address Run your clients including: jini-ext.jar, jini-core.jar, reggie.jar and outrigger.jar 22/24 JavaSpace Advantages Simple: very straightforward API Expressive: small set of operations but complex distributed applications possible. Supports loosely-coupled protocols: Uncouples senders and receivers Dynamic: servers can come and go Eases burden of writing client/server systems Concurrency issues dealt with by space Transactions supported (not described here). 23/24 Further Reading Books Eric Freeman, Susanne Hupfer, Ken Arnold: JavaSpaces Principles, Patterns, and Practice. Addison-Wesley Professional, 1. June 1999, ISBN 0-201-30955-6 Phil Bishop, Nigel Warren: JavaSpaces in Practice. Addison Wesley, 2002, ISBN 0-321-11231-8 Articles Brogden, William (2007). How Web services can use JavaSpaces. SearchWebServices.com Angerer, Bernhard (2003). Space-Based Programming. onjava.com 24/24 8