Implemented clearCacheNode() method to recreate/reset

a node's cache node.
This commit is contained in:
hns 2001-11-26 17:55:57 +00:00
parent 35c78734e8
commit c4fb354f92
3 changed files with 21 additions and 5 deletions

View file

@ -34,11 +34,9 @@ public interface INode extends INodeState, IPathElement {
public String getPrototype ();
public void setPrototype (String prototype);
public INode getCacheNode ();
public void clearCacheNode ();
public String getFullName ();
public String getFullName (INode root);
// public INode[] getPath ();
// public String getUrl (INode root, INode users, String tmpname, String rootproto);
/**
* node-related methods

View file

@ -589,7 +589,9 @@ public class TransientNode implements INode, Serializable {
INode cacheNode;
/**
* Get the cache node for this node. This can be used to store transient cache data per node from Javascript.
* Get the cache node for this node. This can
* be used to store transient cache data per node
* from Javascript.
*/
public synchronized INode getCacheNode () {
if (cacheNode == null)
@ -597,6 +599,13 @@ public class TransientNode implements INode, Serializable {
return cacheNode;
}
/**
* Reset the cache node for this node.
*/
public synchronized void clearCacheNode () {
cacheNode = null;
}
}

View file

@ -1716,7 +1716,8 @@ public final class Node implements INode, Serializable {
/**
* Get the cache node for this node. This can be used to store transient cache data per node from Javascript.
* Get the cache node for this node. This can be
* used to store transient cache data per node from Javascript.
*/
public synchronized INode getCacheNode () {
if (cacheNode == null)
@ -1724,6 +1725,14 @@ public final class Node implements INode, Serializable {
return cacheNode;
}
/**
* Reset the cache node for this node.
*/
public synchronized void clearCacheNode () {
cacheNode = null;
}
/**
* This method walks down node path to the first non-virtual node and return it.
* limit max depth to 3, since there shouldn't be more then 2 layers of virtual nodes.