jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r451955 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state: ChangeLog.java WorkspaceItemStateManager.java
Date Mon, 02 Oct 2006 10:28:58 GMT
Author: angela
Date: Mon Oct  2 03:28:57 2006
New Revision: 451955

URL: http://svn.apache.org/viewvc?view=rev&rev=451955
Log:
work in progress

- delegate cleanup and event-handling to the changelog

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java?view=diff&rev=451955&r1=451954&r2=451955
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
Mon Oct  2 03:28:57 2006
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.jcr2spi.state;
 
 import org.apache.jackrabbit.jcr2spi.operation.Operation;
+import org.apache.jackrabbit.spi.EventIterator;
 import org.apache.commons.collections.iterators.IteratorChain;
 
 import java.util.Iterator;
@@ -273,12 +274,25 @@
     }
 
     //-----------------------------< Inform ChangeLog about Success/Failure >---
+    /**
+     * ChangeLog has successfully been commited. The given <code>EventIterator</code>
+     * contains information about all modifications. This ChangeLog needs
+     * to notify all transient states involved.
+     *
+     * @param events
+     */
+    public void persist(EventIterator events) {
+        // TODO: events may reveal additional autocreated items and modifications
+        // applied while commiting the changelog (e.g. uuid or nodetype of new nodes).
+        push();
+        persisted();
+    }
 
     /**
      * Push all states contained in the various maps of
      * items we have.
      */
-    public void push() {
+    private void push() {
         Iterator iter = modifiedStates();
         while (iter.hasNext()) {
             ((ItemState) iter.next()).push();
@@ -297,7 +311,7 @@
      * After the states have actually been persisted, update their
      * internal states and notify listeners.
      */
-    public void persisted() {
+    private void persisted() {
         Iterator iter = modifiedStates();
         while (iter.hasNext()) {
             ItemState state = (ItemState) iter.next();

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java?view=diff&rev=451955&r1=451954&r2=451955
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java
Mon Oct  2 03:28:57 2006
@@ -115,9 +115,9 @@
         if (changeLog == null) {
             throw new IllegalArgumentException("ChangeLog must not be null.");
         }
-        // now we need to apply the transient changes in changeLog to
-        // the ItemStates in the workspace layer
-        changeLog.push();
-        changeLog.persisted();
+        // apply the transient changes in changeLog to the ItemStates in the
+        // workspace layer and synchronize the changes recorded in the changelog
+        // with the events sent.
+        changeLog.persist(events);
     }
 }



Mime
View raw message