[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Mon Mar 5 14:15:16 EST 2007
User: msurtani
Date: 07/03/05 14:15:16
Modified: src/org/jboss/cache Tag: Branch_JBossCache_1_4_0
TreeCache.java
Log:
JBCACHE-999
Revision Changes Path
No revision
No revision
1.195.2.52 +20 -4 JBossCache/src/org/jboss/cache/Attic/TreeCache.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeCache.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Attic/TreeCache.java,v
retrieving revision 1.195.2.51
retrieving revision 1.195.2.52
diff -u -b -r1.195.2.51 -r1.195.2.52
--- TreeCache.java 28 Feb 2007 18:37:03 -0000 1.195.2.51
+++ TreeCache.java 5 Mar 2007 19:15:16 -0000 1.195.2.52
@@ -99,7 +99,7 @@
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
* @author Brian Stansberry
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Id: TreeCache.java,v 1.195.2.51 2007/02/28 18:37:03 msurtani Exp $
+ * @version $Id: TreeCache.java,v 1.195.2.52 2007/03/05 19:15:16 msurtani Exp $
* <p/>
* @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
*/
@@ -3851,9 +3851,21 @@
public void remove(Fqn fqn) throws CacheException
{
GlobalTransaction tx = getCurrentTransaction();
+ if (fqn.isRoot())
+ {
+ // special treatment for removal of root node - just remove all children
+ Set children = getChildrenNames(fqn);
+ for (Iterator i = children.iterator(); i.hasNext();)
+ {
+ remove(new Fqn(fqn, i.next()));
+ }
+ }
+ else
+ {
MethodCall m = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, new Object[]{tx, fqn, Boolean.TRUE});
invokeMethod(m);
}
+ }
/**
* Called by eviction policy provider. Note that eviction is done only in
@@ -4231,9 +4243,10 @@
if (n.getFqn().isRoot())
{
// do not actually delete; just remove deletion marker
- n.unmarkForRemoval(false);
+ n.unmarkForRemoval(true);
// but now remove all children, since the call has been to remove("/")
n.removeAllChildren();
+
}
else
{
@@ -4765,6 +4778,8 @@
}
}
+ // removing the root node - should never get here!
+ /*
if (fqn.size() == 0)
{
Set children = getChildrenNames(fqn);
@@ -4788,6 +4803,7 @@
}
return;
}
+ */
// Find the node. This will add the temporarily created parent nodes to the TX's node list if tx != null)
n = findNode(fqn, version);
More information about the jboss-cvs-commits
mailing list