Introduction to Jini & JavaSpaces

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

- 1 - Jini in the Enterprise O'Reilly Conference on Java Scott Oaks Sun Microsystems
The Jini Technology Lookup Service. How Does It Work Services and clients find a lookup service using the discovery protocol Services advertise themselves.
1 Jini Tutorial, Part 3 Jini Programming. 2 Tutorial outline Part 1 Introduction Distributed systems Java basics Remote Method Invocation (RMI) Part 2.
TSpaces Services Suite: Automating the Development and Management of Web Services Presenter: Kevin McCurley IBM Almaden Research Center Contact: Marcus.
Executional Architecture
Jini, third verse Richard Chapman October 13, 1999.
Mini project /2 Jini - a new computing paradigm.
JavaSpaces and TSpaces Theresa Tamash CDA 5937 November 4, 2002.
Remote Method Invocation
The road to reliable, autonomous distributed systems
Company LOGO Remote Method Invocation Georgi Cholakov, Emil Doychev, University of Plovdiv “Paisii.
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
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.
One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server.
Comparison of the RMI and the socket APIs
CS 603 Jini April 10, What is Jini? Java Middleware Tools to construct federation –Multiple devices, each with Java Virtual Machine –Multiple services.
Distributed Service Architectures Yitao Duan 03/19/2002.
1 CS 194: Distributed Systems Distributed Coordination-based Systems Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering.
October 2003 Iosif Legrand Iosif Legrand California Institute of Technology.
Parallel Computing using JavaSpaces -Presented by Shilpi Basak Advisor: Prof: Dick Steflik.
© DSRG 2001www.cs.agh.edu.pl Cross Grid Workshop - Kraków Krzysztof Zieliński, Sławomir Zieliński University of Mining and Metallurgy {kz,
Jini Connection Technology Kaushik Lahoti. Jini: A Vision n Areas to focus on –Simplicity –Reliability –Scalability.
Lesson 3 Remote Method Invocation (RMI) Mixing RMI and sockets Rethinking out tic-tac-toe game.
Word Wide Cache Distributed Caching for the Distributed Enterprise.
Jini™ Rashad Oreifej and Christopher Stricklan. Introduction ► Pronounced GEE-nee  Stands for (Java INference engine and networked Interactor)?  Loosely.
Presented by Mark Miyashita
Java RMI Essentials Based on Mastering RMI Rickard Oberg.
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
Introduction - What is Jini Technology?
Nov 6, 2000CS851 Ubiquitous Computing1 The Jini Architecture Speaker: Weisheng Si Dept. of Computer Science University of Virginia.
JavaSpaces Prabhaker Mateti Wright State University.
1 Vrijendra Gokhale, Bernard Menezes K. R. School of Information Technology IIT Bombay User Interfaces for Jini Services The Jini Pattern Language Workshop.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
ACAT 2003 Iosif Legrand Iosif Legrand California Institute of Technology.
Ramiro Voicu December Design Considerations  Act as a true dynamic service and provide the necessary functionally to be used by any other services.
Sun’s Jini Lab 2 Service Registration Client Lookup.
A Look at Jini Jian He Roy Patrick Tan. Outline History Design Goals An Example Basic Components Top View Infrastructures --- Proxies, Discovery/join.
JavaSpaces TM By Stephan Roorda Source: JavaSpaces specification.
Scalable Web Server on Heterogeneous Cluster CHEN Ge.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
1 Lecture 16 Jini Technology Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
JavaSpaces ™ Nati Shalom CTO GigaSpaces Technologies.
1 JSK 1.1 A practical Approach Contents –Working with JSK 1.1 –Jini environments –Writing Jini software revisited –Important software packages in the JSK.
JINI Coordination-Based System By Anthony Friel * David Kiernan * Jasper Wood.
Jini Architecture Introduction System Overview An Example.
Jini Architectural Overview Li Ping
April 2003 Iosif Legrand MONitoring Agents using a Large Integrated Services Architecture Iosif Legrand California Institute of Technology.
PPDG February 2002 Iosif Legrand Monitoring systems requirements, Prototype tools and integration with other services Iosif Legrand California Institute.
Web Services An Introduction Copyright © Curt Hill.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
Enterprise Computing with Jini Technology Mark Stang and Stephen Whinston Jan / Feb 2001, IT Pro presented by Alex Kotchnev.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
January 26, Ken Arnold Copyright 1999 Sun Microsystems, Inc., all rights reserved.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Jini Technology 제 1 회 한국 자바 개발자 컨퍼런스 발표자 : 강신동 Mobile : 소속 : ㈜ idosi.com 대표이사 주최 : JavaCommunity.Org.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Java Distributed Object System
Remote Method Invocation
Bina Ramamurthy Chapter 9
An Introduction of Jini Technology
Bina Ramamurthy Chapter 9
Bina Ramamurthy Chapter 9
JINI ICS 243F- Distributed Systems Middleware, Spring 2001
Introduction to Web Services
Could Jiro™ Extend the Jini™ Pattern Lanuguage?
Distributed System using Web Services
Distributed System using Web Services
Presentation transcript:

Introduction to Jini & JavaSpaces Source references: JGrid project

Agenda Jini SOA Jini intro Jini detailed view Summary

Introduction to Jini

What Is Jini Java Based SOA Platform Designed as a native extension of the J2SDK Project in Sun First announced in 1998 Positioned for dynamic networking

Web Services - SOA Web Services UDDI Registry Find Publish WSDL Client Bind/Invoke WSDL Web Services

Jini SOA Jini Lookup Service Publish Find Java Interface Jini Service Client Publish Bind/Invoke Java Interface Find Jini

Jini Components

How does it work Find Publish Bind/Invoke Jini Client Service Registry Lookup Service Jini Service Publish in both LUS and UDDI Service Proxy Bind/Invoke

Jini – A Detailed view Discovery Registration Lookup Events Leasing Proxies

Unicast discovery LookupLocator lookup = null; ServiceRegistrar registrar = null;   lookup = new LookupLocator(“jini://hostname”); registrar = lookup.getRegistrar(); Lookup Service registrar LUS proxy download Discovery request Service A The service program should perform a unicast discovery to discover the lookup service and obtain a proxy (registrar) for it. Using the registrar proxy we can register a service proxy with the lookup service. A successful registration will return a registration object. The registration object can be used to manage the service proxy within the lookup service, eg to add or modify attributes, get the lease associated with the proxy.

Multicast discovery Discovery is initiated by class LookupDiscovery LookupDiscovery discover = new LookupDiscovery(LookupDiscovery.ALL_GROUPS); Asynchronous responses are handled by a listener object (implementing the DiscoveryListener interface) discover.addDiscoveryListener(listener); Registration public void discovered(DiscoveryEvent e){ //Lookup service discovered – register } multicast request Lookup Service N Unlike in the unicast discovery case, the constructor of the LookupDiscovery class will perform multicast discovery. How to handle asynchronous responses? We do not know how many responses we receive and when. Multicast discovery uses a separate thread – a Listener object – to handle incoming responses from lookup services. The parameter LookupDiscovery.ALL_GROUPS specifies that we are interested in all lookup services of all communities. If you specify a different name, only the lookup service(s) of the community with the matching name will respond. Lookup Service … Discovering entity Lookup Service 2 Lookup Service 1

Main steps Discovery Registration Lookup Events Leasing Proxies

Service registration Once we have a proxy to the lookup service, can register the service ServiceRegistration registration = null; //create serviceItem (no ID, no attributes) Lookup Service Service Proxy registration ServiceItem serviceItem = new ServiceItem(null, new GreetingServiceProxy(), null); download Service A register( ) try{// register for 100 seconds registration registrar.register( serviceItem, 100000L); } catch (java.rmi.RemoteException e){} registrar Service Registration The service proxy is uploaded to the lookup service using the register method of the registrar object. The input parameters are a serviceItem object and an initial lease value specified in milliseconds. The ServiceItem class The ServiceItem object contains the service ID of the service, the service object itself that is being registered, and a set of attributes describing the service. The serviceID of a new service (that was not registered previously) is null. The lookup service will assign a unique service ID to the service. This serviceID must be used in subsequent operations.   REMEMBER: The service object must be serializable. The object will be exported and moved around over the network using RMI. The register() method The object returned by the register() method is an implementation of the ServiceRegistration interface. This object will run in the JVM of the service and, as mentioned earlier, can be used to manipulate the service item registered with the lookup service. Manipulation includes the modification of service attributes, the lease and access to the serviceID using methods addAttributes(), modifyAttributes(), setAttributes(), getLease() and getServiceID(). LUS proxy

Main steps Discovery Registration Lookup Events Leasing Proxies

The client side // create template for service search ... GreetingServiceInterface returnedService = null; try{ returnedService = (GreetingServiceInterface) registrar.lookup(template); }catch (java.rmi.RemoteException e){ } returnedService.hello(); Lookup Service Client 1 Found proxy lookup( ) Interface Template registrar On the client side we first perform a unicast discovery to obtain a proxy for the lookup service. This process is identical to the one on the service side. Then, to be able to perform a service search, we create a template object that describes the type of service we want to find. This description can use the type of the service (in form of a well-known interface) and/or a set of attributes). When the template is constructed, we invoke the lookup() method on the registrar object with the template as input parameter. The lookup will perform a template-matching search of all registered services based on the search rules described earlier. The successful lookup will return one or more services depending on which of the two lookup methods has been used. Note that the lookup in Jini by default performs exact matching. For instance, if you are interested in services with larger than 500 GFlops computing performance, you need to download all computing services and examine their performance attribute individually. This is because the matching is based on serialised objects (ie the proxies).

Main steps Discovery Registration Lookup Events Leasing Proxies

Remote Events Jini provides remote events to make a Jini system dynamic Services coming and going State changes The event mechanism is based on Event registration Event handling through an event listener’s notify() method Events that are routinely used in interactive programs running in a single JVM are very useful in distributed systems too. Distributed systems, however, are different in many ways: the underlying network transport can be unreliable and/or slow events may not arrive in their original order parts of the system run in different JVMs, and on physically different machines event notification should be delayed or transferred to a different object The Jini distributed event model Jini technology extends the notion of event notification to distributed systems and introduces the concept of remote distributed events. The central concept is that an object can register its interest of some state change in another object, and receive notification when that event has happened. This model is deliberately very simple. It does not guarantee reliability and correct timing; it is left to the objects involved to provide correct behaviour in the event notification mechanism.

Main steps Discovery Registration Lookup Events Leasing Proxies

Obtaining a Lease The lease grantor is usually the lookup service and the leaseholder usually is the service.   ServiceRegistration reg = registrar.register(); Lease lease = reg.getLease(); Visually this can be represented as Service A Lookup Service registrar The lease is returned to the service through the ServiceRegistration object (as the result of the registration) using its getLease() method. getLease() registration lease

Main steps Discovery Registration Lookup Events Leasing Proxies

Jini service proxy models There are several ways (patterns) of creating service proxies. A proxy can: Run entirely in the client JVM Be an RMI stub Be a proxy with local logic using RMI to the back end service Be a proxy with local logic using its own communication protocol (e.g. socket) to the back end service Be a wrapper to legacy code (e.g. CORBA)

Introduction to JavaSpaces

What is JavaSpaces? A JINI service that provides distributed shared memory capabilities A simple yet powerful service that can be used for solving distributed programming issues such as: Collaboration WorkFlow Synchronization Distributed Computing

JavaSpaces model Write Read, Take, Notify Read, Take, Notify Write Write –writes a data object. Read – reads a copy of a data object. Take – reads a data object and deletes it. Notify – generates an event on data updates. Write Read, Take, Notify Read, Take, Notify Write

Clustered JavaSpaces

JavaSpaces Methods (Space Operations) JavaSpaces provides a basic API for storing and reading data objects in a shared resource (a space). The methods are: Write –writes a data object. Read – reads a copy of a data object. Take – reads a data object and deletes it. Notify – generates an event on data updates.

Example Entry This shows a minimal entry: package hello; import net.jini.core.entry.Entry; public class Message implements Entry { public String content; public Message() } Must Implements Entry interface Entry Filed need to be public Must include a constructor

Write/Read Operations Instantiate an Entry Set its fields as necessary Write the entry to the space Read an Entry Message msg = new Message(); msg.content = "Hello World"; JavaSpace space = (JavaSpace)SpaceFinder.find( “jini://*/*/JavaSpaces” ); Lease l=space.write(msg, null, Lease.FOREVER); Message template = new Message(); Template.content = “data to match”; Message result = (Message)space.read(template, null, Long.MAX_VALUE);

Notify Operation Registering for notifications // Register a notification template = space.snapshot(new Message()); EventRegistration reg = space.notify( template, null, //TX SpaceEventListener() , // The listener 60000 , // Lease null); // handbag System.out.println( "Notification registered. Registration id: " + reg.getID() + “Sequence number: " + reg.getSequenceNumber());

Parallel Batch Processing Grid engine for parallel processing

Monte Carlo Simulation Details 18,000 Securities, 20 Scenarios, 2,000 Paths/Scenario 1 run = 18K x 20 x 2K (720M) theoretically separate tasks 1 run = 18K x 20 (360k) tasks in reality due to granularity These larger tasks are separable Computation time per task ranges from 20-2000 ms Total computation time in sequence ~100 H Setup for run takes 1-5 minutes First pass attempts with threading on 8-way box used 56 H of elapsed time Using the space with 50 units ~2 H (Source-Invesco)

Scalability & Performance Source: Dr. Alexander Gebhart - Development Architect SAP – JavaOne presentation 2003

Parallel Parsing Grid

Provisioning & Monitoring Using the RIO project

RIO Project - SLA based deployment

Monitoring

Thank You! natis@gigaspaces.com