You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ju...@apache.org on 2013/10/15 16:05:45 UTC

svn commit: r1532343 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/Editor.java

Author: jukka
Date: Tue Oct 15 14:05:44 2013
New Revision: 1532343

URL: http://svn.apache.org/r1532343
Log:
OAK-673: Unified hook processing

Add javadocs to enter/leave

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/Editor.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/Editor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/Editor.java?rev=1532343&r1=1532342&r2=1532343&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/Editor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/Editor.java Tue Oct 15 14:05:44 2013
@@ -36,8 +36,31 @@ import javax.annotation.CheckForNull;
  */
 public interface Editor {
 
+    /**
+     * Called before the given before and after states are compared.
+     * The implementation can use this method to initialize any internal
+     * state needed for processing the results of the comparison. For example
+     * an implementation could look up the effective node type of the after
+     * state to know what constraints to apply to on the content changes.
+     *
+     * @param before before state, non-existent if this node was added
+     * @param after after state, non-existent if this node was removed
+     * @throws CommitFailedException if this commit should be rejected
+     */
     void enter(NodeState before, NodeState after) throws CommitFailedException;
 
+    /**
+     * Called after the given before and after states are compared.
+     * The implementation can use this method to post-process information
+     * collected during the content diff. For example an implementation that
+     * during the diff just recorded the fact that this node was modified
+     * in some way could then use this method to trigger an index update
+     * based on that modification flag.
+     *
+     * @param before before state, non-existent if this node was added
+     * @param after after state, non-existent if this node was removed
+     * @throws CommitFailedException if this commit should be rejected
+     */
     void leave(NodeState before, NodeState after) throws CommitFailedException;
 
     /**