| java.lang.Object ti.chimera.registry.RegistryCore ti.chimera.Registry
Registry | public class Registry extends RegistryCore (Code) | | The registry is a mechanism that allows different parts of the system
share data. It is traditionally used to store registered plugins and
services, but other parts of the system can use the registry to store
or share data. The registry uses a publish-subscribe model, where in
order to track the value of a node, the user subscribes to the node,
and whenever the value of the node changes the most recent value is
published to the subscriber's callback function. The registry will
ensure that changes are published in the order they occur, and that
all changes will be published, even if they've already been super-
ceded by subsequent changes.
The registry is organized as a hierarchical tree, where "nodes" are
either parent nodes (directories) or data nodes. Directory nodes
are just data nodes whose data is a table mapping child names to
nodes. A path is a / delimited string that
specifies how to find a node from the root of the tree. Paths can
contain .. to refer to one level up in the tree, or
. to refer to the current level in the tree.
The registry can be accessed via
ti.chimera.Main.getRegistry or from the script environment variable registry .
author: Rob Clark version: 0.1 See Also: ti.chimera.Main.getRegistry |
Inner Class :abstract class NodeSeeker | |
Registry | Registry(Main main)(Code) | | Class Constructor.
|
getService | public Service getService(String name)(Code) | | Get service provided by a plugin by name. This will automatically
start the plugin providing the service if it has not already been
started.
Parameters: name - the name of the plugin to find See Also: Registry.getServiceNames |
subscribeToCreation | public void subscribeToCreation(String path, NodeCreationSubscriber subscriber)(Code) | | Subscribe to the creation of a node. The subscriber will be called
whenever a node is
Registry.link ed in to the specified path. If the
node already exists, the subscriber will be called (pretty much)
immediately.
Parameters: path - the path to the node to subscribe to Parameters: subscriber - the subscriber |
subscribeToDeletion | public void subscribeToDeletion(String path, NodeDeletionSubscriber subscriber)(Code) | | Subscribe to the deletion of a node. The subscriber will be called
whenever a node is
Registry.unlink ed from the specified path.
Parameters: path - the path to the node to subscribe to Parameters: subscriber - the subscriber |
subscribeToValue | public void subscribeToValue(String path, NodeContract contract, NodeSubscriber subscriber)(Code) | | Subscribe to receive notification of changes to the value of the node
at the specified path. This subscription is relative to the specified
path , and not the node that is currently located at that
path. If there is currently a node at this path, then the subscriber
will be immediately called with the current value, otherwise the
subscriber will be called once the node is created. If the node at
this path is removed, and then at some later time another node is
Registry.link ed in to this path, then the subscriber will subscribed
to that node (and immediately called with it's value), and so on.
If contract is not null , then only subscribe
to the node if it has a compatible contract.
Parameters: path - the path to the node to subscribe to Parameters: contract - the optional contract, or null Parameters: subscriber - the subscriber |
unsubscribeFromCreation | public void unsubscribeFromCreation(NodeCreationSubscriber subscriber)(Code) | | Unsubscribe to the creation of a node. If not subscribed, do nothing.
Parameters: subscriber - the subscriber |
unsubscribeFromDeletion | public void unsubscribeFromDeletion(NodeDeletionSubscriber subscriber)(Code) | | Unsubscribe to the deletion of a node. If not subscribed, do nothing.
Parameters: subscriber - the subscriber |
unsubscribeFromValue | public void unsubscribeFromValue(NodeSubscriber subscriber)(Code) | | Unsubscribe from specified path. If not subscribed, do nothing.
Parameters: subscriber - the subscriber |
|
|