Object Spaces - PowerPoint PPT Presentation

About This Presentation
Title:

Object Spaces

Description:

animation production house (see JavaSpaces TM Principles, Patterns, and Practice: ... space.write(msg, null, Lease.FOREVER); // to read an object from the JavaSpace ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 14
Provided by: csg8
Learn more at: https://cs.gmu.edu
Category:
Tags: download | from | house | install | java | my | object | see | space | spaces

less

Transcript and Presenter's Notes

Title: Object Spaces


1
Object Spaces
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.

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 dont modify objects in
    the space or invoke an objects methods directly.
  • To modify an object, a process must explicitly
    remove it, update it, and reinsert it into the
    space.

4
Object spaces
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.

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.

7
Distributed applications using object spaces - 3
  • Example applications
  • - chatroom
  • auction
  • animation production house
  • (see JavaSpaces TM Principles, Patterns, and
    PracticeChapter 1--Introduction)

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
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).

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 msgnew SpaceObject(SWE622)
  • space.write(msg, null, Lease.FOREVER)
  • // to read an object from the JavaSpace
  • SpaceObject templatenew SpaceObject()
  • SpaceObject result (SpaceObject)space.read(
    template, null, Long.MAX_VALUE)
  • ref textbook, p. 406

11
Samples
  • From JAVASPACES PRINCIPLES, PATTERNS, AND
    PRACTICE
  • http//java.sun.com/docs/books/jini/javaspaces/
  • Chapter1/HelloWorld, HelloWorld2

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.

13
Sources of information
  • The Nuts and Bolts of Compiling and Running
    JavaSpaces Programs have links for downloading
    packages and installation instructions.
    http//www.jiniworld.net/document/javaspace/The
    Nuts and Bolts of Compiling and Running
    JavaSpaces(TM).htm
  • O'Reilly Network First Contact Is There Life in
    JavaSpace? Apr. 05, 2001
Write a Comment
User Comments (0)
About PowerShow.com