All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.tspaces.TupleSpaceObservable

java.lang.Object
   |
   +----java.util.Observable
           |
           +----com.ibm.tspaces.TupleSpaceObservable

public class TupleSpaceObservable
extends Observable
This class implements the subject (or publisher) in the observer pattern from the "Design Patterns" book. It defines a one-to-many dependency between a TupleSpaceObservable and a number of TupleSpaceObservers. When one TupleSpace changes its state, all its dependents are notified and updated automatically.

Author:
Matthias Eichstaedt

Constructor Index

 o TupleSpaceObservable(String, String, int, SuperTuple)
Constructs a new observable for a particular tuple space.
 o TupleSpaceObservable(String, String, SuperTuple)
Constructs a new observable for a particular tuple space.
 o TupleSpaceObservable(String, SuperTuple)
Constructs a new observable for a particular tuple space.

Method Index

 o dispose()
Disposes this tuplespace publisher.
 o setChanged()
Indicates that this object has changed.

Constructors

 o TupleSpaceObservable
 public TupleSpaceObservable(String spaceName,
                             SuperTuple templateTuple) throws TupleSpaceException
Constructs a new observable for a particular tuple space.

Parameters:
spaceName - - name of the tuplespace
templateTuple - - tuple template for the query
 o TupleSpaceObservable
 public TupleSpaceObservable(String spaceName,
                             String serverName,
                             SuperTuple templateTuple) throws TupleSpaceException
Constructs a new observable for a particular tuple space.

Parameters:
spaceName - - name of the tuplespace
serverName - - name of the tuplespace server
templateTuple - - tuple template for the query
 o TupleSpaceObservable
 public TupleSpaceObservable(String spaceName,
                             String serverName,
                             int port,
                             SuperTuple templateTuple) throws TupleSpaceException
Constructs a new observable for a particular tuple space.

Parameters:
spaceName - - name of the tuplespace
serverName - - name of the tuplespace server
port - - port number
templateTuple - - tuple template for the query

Methods

 o dispose
 public synchronized void dispose()
Disposes this tuplespace publisher. Always invoke this method when you need to get rid of a tuplespace publisher.

 o setChanged
 protected void setChanged()
Indicates that this object has changed.

Overrides:
setChanged in class Observable

All Packages  Class Hierarchy  This Package  Previous  Next  Index