com.ibm.tspaces
Class TupleSpaceObservable

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

public class TupleSpaceObservable
extends java.util.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 Summary
TupleSpaceObservable(java.lang.String spaceName, java.lang.String serverName, int port, SuperTuple templateTuple)
          Constructs a new observable for a particular tuple space.
TupleSpaceObservable(java.lang.String spaceName, java.lang.String serverName, SuperTuple templateTuple)
          Constructs a new observable for a particular tuple space.
TupleSpaceObservable(java.lang.String spaceName, SuperTuple templateTuple)
          Constructs a new observable for a particular tuple space.
 
Method Summary
 void dispose()
          Disposes this tuplespace publisher.
protected  void setChanged()
          Indicates that this object has changed.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleSpaceObservable

public TupleSpaceObservable(java.lang.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
Throws:
TupleSpaceException -  

TupleSpaceObservable

public TupleSpaceObservable(java.lang.String spaceName,
                            java.lang.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
Throws:
TupleSpaceException -  

TupleSpaceObservable

public TupleSpaceObservable(java.lang.String spaceName,
                            java.lang.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
Throws:
TupleSpaceException -  
Method Detail

dispose

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

setChanged

protected void setChanged()
Indicates that this object has changed.
Overrides:
setChanged in class java.util.Observable