Download presentation
Presentation is loading. Please wait.
1
Object Spaces 9/22/2018
2
History Object spaces is a computing paradigm originated by Dr. David Gelernter at Yale University. A language called Linda was developed to support the concept of global object coordination. A space is a shared, network-accessible repository for objects. Instead of communicating with each other, processes coordinate by exchanging objects through one or more spaces. 9/22/2018
3
ObjectSpace - concept A space may be transient, or it may be persistent. An object may be identified using properties lookup; if a desired object is not currently available, a process can wait until one arrives. Objects deposited in a space are passive. Unlike other models, processes don’t modify objects in the space or invoke an object’s methods directly. To modify an object, a process must explicitly remove it, update it, and reinsert it into the space. 9/22/2018
4
Object spaces 9/22/2018
5
Distributed applications using object spaces
Applications based on object spaces-- A distributed data structure: is composed of multiple objects that are stored in one or more spaces. A distributed protocol: defines the way participants share and modify these data structures in a coordinated way. 9/22/2018
6
Distributed applications using object spaces - 2
Example: The participants are a set of controllers for printers. The data structure is a queue of printing tasks for multiple printers The protocol may be that each participant will try to coordinate with each other to avoid duplicating the same task and to handle errors. 9/22/2018
7
Distributed applications using object spaces - 3
Example applications - chatroom: – auction: – animation production house (see JavaSpaces TM Principles, Patterns, and Practice: Chapter 1--Introduction) 9/22/2018
8
JavaSpaces Is an implementation which supports the object space paradigm. Is based on Jini – it runs on top of Jini, as a service. To install the package, you need: jdk1.2.x Jini1_0_1 (jini toolkit) Jstk1_0_1 (java space toolkit) 9/22/2018
9
JavaSpaces - 2 To run JavaSpaces, you need an infrastructure in place:
An HTTP server, used to download code to JavaSpaces clients. An RMI Activation Daemon, for managing the states of Jini services. A Lookup service: for Jini service location (reggie). A JavaSpaces service (outrigger) . Optionally, a transaction service (mahalo). 9/22/2018
10
JavaSpaces API import net.jini.core.lease.Lease;
import net.jini.space.JavaSpace; // to access a JavaSpace JavaSpace space = SpaceAccessor.getSpace(); // to deposit a net.jini.core.entry.Entry object into the JavaSpace SpaceObject msg=new SpaceObject(“SWE622”); space.write(msg, null, Lease.FOREVER); // to read an object from the JavaSpace SpaceObject template=new SpaceObject(); SpaceObject result = (SpaceObject)space.read( template, null, Long.MAX_VALUE); ref: textbook, p. 406 9/22/2018
11
Samples From: JAVASPACES PRINCIPLES, PATTERNS, AND PRACTICE
Chapter1/HelloWorld, HelloWorld2 9/22/2018
12
Advantages of using JavaSpaces (Freeman, et al)
Simplicity. Expressive: “Using a small set of operations, we can build a large class of distributed applications without writing a lot of code.” It supports loosely coupled protocols. It eases the burden of writing client/server systems: the functionalities of the server are provided for free, via the spaces; in most cases only the client code needs to be written. 9/22/2018
13
Sources of information
The Nuts and Bolts of Compiling and Running JavaSpaces Programs: have links for downloading packages and installation instructions. Nuts and Bolts of Compiling and Running JavaSpaces(TM).htm O'Reilly Network: First Contact: Is There Life in JavaSpace? [Apr. 05, 2001] 9/22/2018
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.