helma.objectmodel.db
Class NodeHandle

java.lang.Object
  extended by helma.objectmodel.db.NodeHandle
All Implemented Interfaces:
INodeState, java.io.Serializable

public final class NodeHandle
extends java.lang.Object
implements INodeState, java.io.Serializable

This class is a handle or reference to a Node. This is to abstract from different methods of reference: Transient Nodes are referred to directly, while persistent nodes are referred to via key/node manager. A handle is used to refer to a node in a safe way over a longer period. While a direct reference may point to a node that has been evicted from the cache and reinstanciated since being set, NodeHandle will always return an up-to-date instance of its node.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface helma.objectmodel.INodeState
CLEAN, DELETED, INVALID, MODIFIED, NEW, TRANSIENT, VIRTUAL
 
Constructor Summary
NodeHandle(Key key)
          Builds a handle given a node's retrieval information.
NodeHandle(Node node)
          Builds a handle for a node
 
Method Summary
protected  void becomePersistent()
          This is to notify the handle that the underlying node is becoming persistent and we have to refer to it via the key from now on.
 boolean equals(java.lang.Object other)
           
 java.lang.String getID()
          Get the ID for the node described by this handle.
 Key getKey()
          Get the key for the node described by this handle.
 Node getNode(WrappedNodeManager nodemgr)
          Get the node described by this node handle
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeHandle

public NodeHandle(Node node)
Builds a handle for a node


NodeHandle

public NodeHandle(Key key)
Builds a handle given a node's retrieval information. At the time this is called, the node is ususally not yet created. It will be fetched on demand when accessed by application code.

Method Detail

getNode

public Node getNode(WrappedNodeManager nodemgr)
Get the node described by this node handle


getKey

public Key getKey()
Get the key for the node described by this handle. This may only be called on persistent Nodes.


getID

public java.lang.String getID()
Get the ID for the node described by this handle. This may only be called on persistent Nodes.


equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object
Parameters:
other - ...
Returns:
...

becomePersistent

protected void becomePersistent()
This is to notify the handle that the underlying node is becoming persistent and we have to refer to it via the key from now on.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
...


Copyright © 1998-1998-${year} Helma.org. All Rights Reserved.