You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2013/01/14 14:11:39 UTC

svn commit: r1432907 - in /jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena: sparql/modify/UpdateEngine.java sparql/modify/UpdateEngineMain.java update/UpdateProcessor.java

Author: rvesse
Date: Mon Jan 14 13:11:39 2013
New Revision: 1432907

URL: http://svn.apache.org/viewvc?rev=1432907&view=rev
Log:
Further API stubs for update cancellation (JENA-382)

Modified:
    jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngine.java
    jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngineMain.java
    jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/update/UpdateProcessor.java

Modified: jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngine.java
URL: http://svn.apache.org/viewvc/jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngine.java?rev=1432907&r1=1432906&r2=1432907&view=diff
==============================================================================
--- jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngine.java (original)
+++ jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngine.java Mon Jan 14 13:11:39 2013
@@ -18,7 +18,34 @@
 
 package com.hp.hpl.jena.sparql.modify;
 
+/**
+ * Interface for engines that actually implement execution of updates
+ *
+ */
 public interface UpdateEngine  
 {
+	/**
+	 * Executes the updates the engine was intialized with
+	 */
     public void execute() ;
+    
+    /**
+     * Cancels execution of the updates
+     * <p>
+     * If update execution has already completed then calling this will have no effect unless the
+     * caller invokes {@link #execute()} again.
+     * </p>
+     * <p>
+     * If the update engine has yet to start execution this should have no immediate effect
+     * but should cause the engine to throw an error if and when {@link #execute()} is called.
+     * </p>
+     * <p>
+     * If the engine is carrying out the execution then it should halt and abort the update as soon
+     * as it is able.  The side effects of cancellation with regards to things like transactions
+     * should be the same as if an error occurred in update processing i.e. transactions should be rolled
+     * back or marked as un-commitable and an error should be thrown for the user to handle as desired.
+     * </p>
+     * @exception UnsupportedOperationException Thrown if cancellation is not supported
+     */
+    public void cancel() ;
 }

Modified: jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngineMain.java
URL: http://svn.apache.org/viewvc/jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngineMain.java?rev=1432907&r1=1432906&r2=1432907&view=diff
==============================================================================
--- jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngineMain.java (original)
+++ jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngineMain.java Mon Jan 14 13:11:39 2013
@@ -60,6 +60,14 @@ public class UpdateEngineMain extends Up
     }
     
     /**
+     * Cancels the updates
+     */
+    public void cancel()
+    {
+    	throw new UnsupportedOperationException("Update cancellation is not yet supported");
+    }
+    
+    /**
      * Creates the {@link UpdateVisitor} which will do the work of applying the updates
      * @return The update visitor to be used to apply the updates
      */

Modified: jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/update/UpdateProcessor.java
URL: http://svn.apache.org/viewvc/jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/update/UpdateProcessor.java?rev=1432907&r1=1432906&r2=1432907&view=diff
==============================================================================
--- jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/update/UpdateProcessor.java (original)
+++ jena/Experimental/cancellable-updates/src/main/java/com/hp/hpl/jena/update/UpdateProcessor.java Mon Jan 14 13:11:39 2013
@@ -50,6 +50,10 @@ public interface UpdateProcessor
     /**
      * Cancels execution if cancellation is supported
      * <p>
+     * If update execution has already completed then calling this will have no effect unless the
+     * caller invokes {@link #execute()} again.
+     * </p>
+     * <p>
      * If the update processor has yet to start execution this should have no immediate effect
      * but should cause the processor to throw an error if and when {@link #execute()} is called.
      * </p>