[dna-commits] DNA SVN: r839 - trunk/dna-jcr/src/main/java/org/jboss/dna/jcr.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Fri Apr 17 10:23:57 EDT 2009


Author: rhauch
Date: 2009-04-17 10:23:57 -0400 (Fri, 17 Apr 2009)
New Revision: 839

Modified:
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
Log:
DNA-359 Session.refresh and Node.refresh Methods Not Supported

Added a short-circuit for 'refresh(UUID,boolean)' that checks whether the supplied UUID is that of the root, and if so 'refresh(boolean)' is called since it is significantly more efficient.

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-04-17 14:21:31 UTC (rev 838)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-04-17 14:23:57 UTC (rev 839)
@@ -268,6 +268,13 @@
      */
     public void refresh( UUID nodeUuid,
                          boolean keepChanges ) throws RepositoryException {
+        assert nodeUuid != null;
+        // If the node being refreshed is the root node, then it's more efficient to refresh the whole workspace ...
+        if (this.root.equals(nodeUuid)) {
+            refresh(keepChanges);
+            return;
+        }
+
         // Build the set of affected node UUIDs
         Set<UUID> nodesUnderBranch = new HashSet<UUID>();
         Stack<UUID> nodesToVisit = new Stack<UUID>();




More information about the dna-commits mailing list