JavaSpaces ™ Nati Shalom CTO GigaSpaces Technologies.

Slides:



Advertisements
Similar presentations
- 1 - Jini in the Enterprise O'Reilly Conference on Java Scott Oaks Sun Microsystems
Advertisements

An Introduction of Jini Technology Presenter: Carfield Yim, Gary Lam Date: 31-Jul-2002 How can JINI Technology Boost Our Business.
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.
Jini Tutorial, Part 2 Jini Overview.
JINI Network Technology
JavaSpaces and TSpaces Theresa Tamash CDA 5937 November 4, 2002.
JINI Shashwat Shriparv InfinitySoft.
Linda Coordination Language Presented by Tae Ki Kim
The road to reliable, autonomous distributed systems
Introduction to Jini & JavaSpaces
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.
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.
Parallel Computing using JavaSpaces -Presented by Shilpi Basak Advisor: Prof: Dick Steflik.
490dp Prelude I: Group Membership Prelude II: Team Presentations Tuples Robert Grimm.
Pay As You Go – Associating Costs with Jini Leases By: Peer Hasselmeyer and Markus Schumacher Presented By: Nathan Balon.
TupleSpaces Revisited: Linda to TSpaces Ben Y. Zhao 13 July, 1998 UC Berkeley Computer Science Division.
Word Wide Cache Distributed Caching for the Distributed Enterprise.
Research on cloud computing application in the peer-to-peer based video-on-demand systems Speaker : 吳靖緯 MA0G rd International Workshop.
Presented by Mark Miyashita
Cloud Computing 1. Outline  Introduction  Evolution  Cloud architecture  Map reduce operation  Platform 2.
DISTRIBUTED COMPUTING
JavaSpaces Prabhaker Mateti Wright State University.
January 26, Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
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.
In the name of Allah The Proxy Pattern Elham moazzen.
1 4/23/2007 Introduction to Grid computing Sunil Avutu Graduate Student Dept.of Computer Science.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
1 UNIT –II Architecting Web Service. 2 Why SOA? – business point of view  Information Technology (IT) workers face many challenges, including: Limited.
Distributed Systems Principles and Paradigms Chapter 12 Distributed Coordination-Based Systems 01 Introduction 02 Communication 03 Processes 04 Naming.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
1 Lecture 16 Jini Technology Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Enterprise Integration Patterns CS3300 Fall 2015.
Distributed Coordination-Based Systems Adapted from: "Distributed Systems", Tanenbaum & van Steen, course slides.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
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.
1 Object Oriented Logic Programming as an Agent Building Infrastructure Oct 12, 2002 Copyright © 2002, Paul Tarau Paul Tarau University of North Texas.
Jini Architectural Overview Li Ping
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
PPDG February 2002 Iosif Legrand Monitoring systems requirements, Prototype tools and integration with other services Iosif Legrand California Institute.
V1-5Coordination Based Systems1 Distributed Coordination Based Systems.
GRID ANATOMY Advanced Computing Concepts – Dr. Emmanuel Pilli.
Christian Stiller Technical Account Manager SOA-23: Enterprise Integration Patterns in Sonic ™ ESB.
Enterprise Computing with Jini Technology Mark Stang and Stephen Whinston Jan / Feb 2001, IT Pro presented by Alex Kotchnev.
January 26, Ken Arnold Copyright 1999 Sun Microsystems, Inc., all rights reserved.
JINI – A next Generation Networking Technology Part I – Introduction.
Object Spaces 9/22/2018.
Distributed Systems Bina Ramamurthy 11/30/2018 B.Ramamurthy.
Chapter 40 Remote Method Invocation
Event Pipeline Pattern
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
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
The Anatomy and The Physiology of the Grid
Jini B.Ramamurthy 5/15/2019 B.Ramamurthy.
System Models Bina Ramamurthy 9/7/2019 B.Ramamurthy.
Presentation transcript:

JavaSpaces ™ Nati Shalom CTO GigaSpaces Technologies

Goals Introduction to JavaSpaces™ technology and it’s functions and usage within the Java Services Framework.

Learning Objectives As a result of this presentation, you will be able to: Understand the Space Concept Know more about Java Services Architecture Learn about JavaSpaces™ simplicity and strength Figure out the position of JavaSpaces™ in the overall Java Architecture

Speaker’s Qualifications Nati Shalom is a C.T.O and Co Founder of GigaSpaces a Software Company that specializes in Performance & Scalability of Distributed application using Distributed Shared Memory & JavaSpaces™. Nati Shalom have a vast experience in distributed computing technologies such as CORBA, JINI, Web Services, J2EE Nati Shalom is active in various technological forums such as GRID consortium, SUN/JINI group, I.JUG Nati Shalom is managing the I.JUG Web Services track. Nati Shalom speaks frequently on those topics in conferences and technical courses

Agenda What Is A Space What Is JavaSpaces™ JavaSpaces™ Benefits Programming with JavaSpaces™ The Service Oriented Architecture (SOA) JINI Service Platform Summary & References

What is a space: Write Writing an object into a shared pool memory Read Reading and object from a shared pool memory Take Reading and Deleting an object from a shared pool memory Notify Setting and Receiving notifications of changes made within the shared pool memory Small & Powerful API A Network service for Sharing and Exchanging information between distributed services:

Agenda What Is A Space What Is JavaSpaces™ JavaSpaces™ Benefits Programming with JavaSpaces™ The Service Oriented Architecture (SOA) JINI Service Platform Summary & References

What Is JavaSpaces? Distributed Shared Memory A Jini ™ Service Transactionally Secure Astonishingly Simple Based on “tuple-spaces” (see David Gelernter’s Linda system)

JavaSpaces Benefits Boost the performance of the Distributed Applications: Distributed Caching Parallel Processing Batching of remote calls. Provides a generic solution for addressing the scalability and high availability of the distributed applications. Hides the complexity of the distributed world: Anonymity between applications Uncoupled communication Programs can communicate through time or space Vast savings in design and development time

JavaSpaces Concepts High-level communications between Java program SIMPLE: only a few operations to learn EXPRESSIVE: a large number of computing problems can be solved

Agenda What Is A Space What Is JavaSpaces™ JavaSpaces™ Benefits Programming with JavaSpaces™ The Service Oriented Architecture (SOA) JINI Service Platform Summary & References

JavaSpaces Programs Processes are decoupled from one another Indirect interaction through one or more spaces

Matching Entries A template is used to match entries in a space The template is simply an entry of the type to be matched Fields of the entry are used for matching Non-assigned fields are wildcards

Entries Entries are collections of typed objects Must implement net.jini.core.entry.Entry Fields can be any Serializable Java ™ object Fields must be public to be matchable Entry needs no-arg constructor

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 include a constructor Entry Filed need to be public Must Implements Entry interface

Accessing a Space Jini is used to locate a space Sun’s implementation identifies spaces by name. GigaSpaces identifies spaces by name, container, persistency Convenience method from GigaSpaces: SpaceFinder.find(jini://*/*/spaceName);

Space Operations Very small number of operations are defined on a space The three fundamental operations are: Write Read Take

Write Operation Writes an entry to a space

Write Operation Instantiate an Entry Set its fields as necessary Write the entry to the space Message msg = new Message(); msg.content = "Hello World"; JavaSpace space = (JavaSpace)SpaceFinder.find( args[0] ); space.write(msg, null, Lease.FOREVER);

Read Operation Reads an entry from a space Copy of object is returned Original remains in space

Read Operation Build a template Read a matching entry from the space Message template = new Message(); Message result = (Message)space.read(template, null, Long.MAX_VALUE);

Take Operation Takes an entry from a space Matched entry is removed from space

Take Operation Build a template Take a matching entry from the space Message template = new Message(); Message result = (Message)space.take(template, null, Long.MAX_VALUE);

Snapshot Operation The snapshot operation is used for performance optimization It generates an image of the Entry. This image usually saves the serialization overhead. Message template = new Message(); Entry snapshot = space.snapshot(template) Message result = (Message)space.read( snapshot, null, Long.MAX_VALUE);

The Notify Operation The space implements the JINI RemoteEvents pattern Clients can register for events on write operation using the notify method. The notify callback should implement a RemoteEventListener

Notify Operation (Cont) 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());

The Notify Operation (Cont) RMI Event Listener public class SpaceEventListener extends UnicastRemoteObject implements RemoteEventListener { public SpaceEventListener() throws java.rmi.RemoteException{} public void notify(net.jini.core.event.RemoteEvent theEvent) throws net.jini.core.event.UnknownEventException, java.rmi.RemoteException { System.out.println("\nGot event from space:"); System.out.println("Event Source: " + theEvent.getSource()); System.out.println("Event Id: " + theEvent.getID()); } }

Other Space Operations ReadIfExists() Non-blocking read takeIfExists() Non-blocking take

Clustering Models With JavaSpaces Clustered Space A network of cooperating spaces with single, virtual, interface Replication Manages the distribution of work between the cluster spaces Fail-Over Manages the process of transparent re-routing in case of failure during an active session Load Balancing Enables partial or full replication between groups of spaces.

Agenda What Is A Space What Is JavaSpaces™ JavaSpaces™ Benefits Programming with JavaSpaces™ The Service Oriented Architecture (SOA) JINI Service Platform Summary & References

The Service Oriented Approach What’s Missing ? Data sharing between services Activities synchronized between services Data collaboration between services Optimal Performance Application ABC Components Becomes… Component Oriented Composite Application ABC Services Service Oriented

Using JavaSpaces™ as a Shared Address Space between services The Space itself is A SERVICE that provides Shared Memory Capabilities. Services allocate space dynamically. Unique Benefits: Performance Distributed Caching Parallel Processing Virtualization Collaboration Synchronization Personalization Session Sharing Single Sign On Composite Application ABC Services Distributed Shared Memory Service Distributed Shared Memory Service

Enterprise Service Bus “In 2002, a new form of infrastructure that combines Web services, messaging, basic transformation and content-based routing came to market. These low-cost, application-server-neutral enterprise service buses (ESBs) are well suited to be the backbones for SOAs and basic ENSs.” Source: “From Enterprise Network to Enterprise Nervous System” Massimo Pezzini, 10–12 March 2003

Why Now? (Cont) Network vs. computer performance Computer speed doubles every 18 months Network speed doubles every 9 months Difference = order of magnitude per 5 years 1986 to 2000 Computers: x 500 Networks: x 340, to 2010 Computers: x 60 Networks: x 4000 Moore’s Law vs. storage improvements vs. optical improvements. Graph from Scientific American (Jan-2001).

Agenda What Is A Space What Is JavaSpaces™ JavaSpaces™ Benefits Programming with JavaSpaces™ The Service Oriented Architecture (SOA) JINI Service Platform Summary & References

The JINI Services Architecture

Structure of Jini ™ Technology

Step 1: Registering a Service

Step 2: Finding a Service Client Lookup Service

Step 3: Using a Service

JoinManager & DiscoveryManager Locating services can be done using the utility classes of ``Discovery Management'‘ The JoinManager uses the DiscoveryManager for locating an LUS. It than register the service with each LUS. The JoinManager provides two constructors: No serviceId – This constructor should be used in the first time the service has been registered. With serviceId - This constructor should be used after the service had been assigned atleast once a service id.

Example:Joining A Service with all LUS JoinManager joinMgr = null; try { LookupDiscoveryManager mgr = new LookupDiscoveryManager(LookupDiscovery.ALL_GROUPS, null /* unicast locators */, null /* DiscoveryListener */); joinMgr = new JoinManager(new FileClassifierImpl(), /* service */ null /* attr sets */, this /* ServiceIDListener*/, mgr /* DiscoveryManagement */, new LeaseRenewalManager()); } catch(Exception e) {..}

ServiceDiscoveryManager The class ServiceDiscoveryManager is only available in Jini 1.1. It performs client-side functions similar to that of JoinManager for services, and simplifies the tasks of finding services

ServiceDiscoveryManager Goals The ServiceDiscoveryManager was designed to assist clients with the following tasks: A client may wish to use a service immediately or later A client may want to use multiple services A client will want to find services by their interface, but may also want to apply additional criteria, such as being a ``fast enough'' printer A client may just wish to use a service if it is available at the time of request, but alternatively may want to be informed of new services becoming available and respond to this new availability (for example, a service browser)

The ServiceDiscoveryManger Interface public class ServiceDiscoveryManager { public ServiceDiscoveryManager(DiscoveryManagement discoveryMgr, LeaseRenewalManager leaseMgr) throws IOException; LookupCache createLookupCache(ServiceTemplate tmpl, ServiceItemFilter filter, ServiceDiscoveryListener listener); ServiceItem[] lookup(ServiceTemplate tmpl, int maxMatches, ServiceItemFilter filter); ServiceItem lookup(ServiceTemplate tmpl, ServiceItemFilter filter); ServiceItem lookup(ServiceTemplate tmpl, ServiceItemFilter filter, long wait); ServiceItem[] lookup(ServiceTemplate tmpl, int minMaxMatch, int maxMatches, ServiceItemFilter filter, long wait); void terminate(); }

Finding a Service Immediately try { LookupDiscoveryManager mgr = new LookupDiscoveryManager(LookupDiscovery.ALL_GROUPS, null /* unicast locators */, null /* DiscoveryListener */); clientMgr = new ServiceDiscoveryManager(mgr, new LeaseRenewalManager()); } catch( … ) {.. } Class [] classes = new Class[] {FileClassifier.class}; ServiceTemplate template = new ServiceTemplate(null, classes, null); ServiceItem item = null; // Try to find the service, blocking till timeout if necessary try { item = clientMgr.lookup(template, null, /* no filter */ WAITFOR /* timeout */); } catch(..) {..}

The Details: Programming using Leases, Events, and Transactions

Why Distributed Leasing? Problem: Partial failure in distributed systems can lead to unchecked resource consumption Traditional solution: system administration Error-prone Costly Only happens when it’s too late

Distributed Leasing in Jini™ Protocol for managing resources using a renewable, duration-based model Contract between objects Resources can be shared or private Provides a method of managing resources in an environment where network failures can, and do, occur

What are Leases? Time-based grants of resources or services Loose contracts between grantor and holder Negotiated for a set period of time Can be shared or exclusive

Lease Operations Leases may be: Cancelled (explicit cleanup) Renewed (explicit extension) Allowed to expire (implicit cleanup) Obtained and manipulated by third parties

Distributed Leasing Resources are allocated only as long as continued interest is shown Leasee is responsible to renew lease before expiry The network is self-healing

Distributed Events Extend Java™ event model to work in a distributed network Register interest, receive notification Allow for use of event managers Support various delivery models Push, pull, filter Use the Distributed Leasing protocol

Transaction model in Jini™ Designed for distributed object coordination Light weight, object-oriented Supports two-phase commits Uses Distributed Leasing protocol Implemented in Transaction Manager service

Agenda What Is A Space What Is JavaSpaces™ JavaSpaces™ Benefits Programming with JavaSpaces™ The Service Oriented Architecture (SOA) JINI Service Platform Summary & References

GigaSpaces Free Academic Program GigaSpaces Free Academic Program Is available through the web site.

JavaSpaces™ Resources Visit our GigaSpaces booth.

Thank you for listening