From c4fb354f92ab2e3ee585f09d267495d8c2e457ff Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 26 Nov 2001 17:55:57 +0000 Subject: [PATCH] Implemented clearCacheNode() method to recreate/reset a node's cache node. --- src/helma/objectmodel/INode.java | 4 +--- src/helma/objectmodel/TransientNode.java | 11 ++++++++++- src/helma/objectmodel/db/Node.java | 11 ++++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/helma/objectmodel/INode.java b/src/helma/objectmodel/INode.java index 1a40ef3e..b73e15d6 100644 --- a/src/helma/objectmodel/INode.java +++ b/src/helma/objectmodel/INode.java @@ -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 diff --git a/src/helma/objectmodel/TransientNode.java b/src/helma/objectmodel/TransientNode.java index 180d0bf5..96e5cab4 100644 --- a/src/helma/objectmodel/TransientNode.java +++ b/src/helma/objectmodel/TransientNode.java @@ -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; + } + } diff --git a/src/helma/objectmodel/db/Node.java b/src/helma/objectmodel/db/Node.java index 4b4d2697..60dcc6a1 100644 --- a/src/helma/objectmodel/db/Node.java +++ b/src/helma/objectmodel/db/Node.java @@ -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.