[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
manik at jboss.org
Wed Mar 7 13:01:09 EST 2007
User: msurtani
Date: 07/03/07 13:01:09
Modified: src/org/jboss/cache NodeSPI.java UnversionedNode.java
Log:
JBCACHE-961 - more sophisticated merging of child maps in workspace nodes.
Revision Changes Path
1.17 +8 -0 JBossCache/src/org/jboss/cache/NodeSPI.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeSPI.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/NodeSPI.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- NodeSPI.java 9 Feb 2007 17:23:57 -0000 1.16
+++ NodeSPI.java 7 Mar 2007 18:01:09 -0000 1.17
@@ -240,6 +240,14 @@
NodeSPI addChildDirect(Fqn childName);
/**
+ * Directly adds the node passed in to the children map of the current node. Will throw a CacheException if
+ * <tt>child.getFqn().getParent().equals(getFqn())</tt> returns false.
+ *
+ * @param child child to add
+ */
+ void addChildDirect(NodeSPI child);
+
+ /**
* Retrives a child directly by fully qualified name.
* Functionally the same as {@link #getChild(Fqn)} except that it bypasses the
* interceptor chain.
1.25 +14 -1 JBossCache/src/org/jboss/cache/UnversionedNode.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UnversionedNode.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/UnversionedNode.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- UnversionedNode.java 7 Feb 2007 22:06:44 -0000 1.24
+++ UnversionedNode.java 7 Mar 2007 18:01:09 -0000 1.25
@@ -345,6 +345,19 @@
return getChild(f);
}
+ public void addChildDirect(NodeSPI child)
+ {
+ if (child.getFqn().getParent().equals(getFqn()))
+ {
+ synchronized (this)
+ {
+ children.put(child.getFqn().getLastElement(), child);
+ }
+ }
+ else
+ throw new CacheException("Attempting to add a child [" + child.getFqn() + "] to [" + getFqn() + "]. Can only add direct children.");
+ }
+
public NodeSPI addChildDirect(Fqn f)
{
if (f.size() == 1)
More information about the jboss-cvs-commits
mailing list