ti.chimera.registry
Class PersistentNode

java.lang.Object
  extended byti.chimera.registry.Node
      extended byti.chimera.registry.PersistentNode

public class PersistentNode
extends Node

A node that persistently stores its value. When a persistent node is first linked in to the tree, it checks for a previously stored value, as identified by the primary path (ie. the first path the node is linked to) and if a previously stored value is found, it overrides the initial value specified in the constructor. The value of a persistent node must be Serializable.

Note that currently values of a persistent node are stored when they are set, rather than at system exit, so the stored value won't reflect side- effects... for example if the value is a list, and an element is added to the list after the value of the node gets set, the stored value won't reflect the element added to the list. This is deemed to be the correct behavior because it is consistent with the registry in that values of registry nodes are only published to subscribers when they are changed (via setValue(java.lang.Object)).

Description of properties that are interesting:

property description regular default webstart default
chimera.config.path where the persistent registry nodes are stored $CWD/config.jar $HOME/.config.jar

Version:
0.1
Author:
;Rob Clark;a0873619;San Diego;;

Nested Class Summary
 
Nested classes inherited from class ti.chimera.registry.Node
Node.NonSwingWorker, Node.SwingWorker
 
Constructor Summary
PersistentNode(java.lang.Object value, NodeContract contract, java.lang.String comment)
          Class Constructor.
 
Method Summary
 void setValue(java.lang.Object value)
          Set the value of this node, and publish the new value to all the subscribers.
 
Methods inherited from class ti.chimera.registry.Node
getComment, getNodeContract, getPrimaryPath, getValue, subscribe, toString, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentNode

public PersistentNode(java.lang.Object value,
                      NodeContract contract,
                      java.lang.String comment)
Class Constructor.

Parameters:
value - the node's initial value
contract - the node's contract, or null
comment - a string containing a description of the purpose of this node, the node's usage, etc. Can contain HTML markup.
Method Detail

setValue

public void setValue(java.lang.Object value)
Set the value of this node, and publish the new value to all the subscribers.

Overrides:
setValue in class Node
Parameters:
value - the node's new value