incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r995945 - /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
Date Fri, 10 Sep 2010 19:19:23 GMT
Author: cziegeler
Date: Fri Sep 10 19:19:22 2010
New Revision: 995945

URL: http://svn.apache.org/viewvc?rev=995945&view=rev
Log:
SLING-1754 : Jobs nodes should be unlocked after they have been changed

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java?rev=995945&r1=995944&r2=995945&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
Fri Sep 10 19:19:22 2010
@@ -1393,18 +1393,11 @@ public class JobEventHandler
                 this.logger.error("Unable to access repository to check job node.", re);
                 errorOccured = false;
             }
+            final String jobId = (String)job.getProperty(EventUtil.PROPERTY_JOB_ID);
             if ( eventNode != null ) {
-                // unlock node
-                try {
-                    this.backgroundSession.getWorkspace().getLockManager().unlock(eventNode.getPath());
-                } catch (RepositoryException e) {
-                    // if unlock fails, we silently ignore this
-                    this.ignoreException(e);
-                }
                 // update status in repository
                 try {
                     if ( !reschedule ) {
-                        final String jobId = (String)job.getProperty(EventUtil.PROPERTY_JOB_ID);
                         if ( jobId == null ) {
                             // remove node from repository if no job id is set
                             eventNode.remove();
@@ -1422,6 +1415,15 @@ public class JobEventHandler
                     // if an exception occurs, we just log
                     this.logger.error("Exception during finished job update.", re);
                 }
+                if ( reschedule || jobId != null ) {
+                    // unlock node
+                    try {
+                        this.backgroundSession.getWorkspace().getLockManager().unlock(eventNode.getPath());
+                    } catch (RepositoryException e) {
+                        // if unlock fails, we silently ignore this
+                        this.ignoreException(e);
+                    }
+                }
             }
         }
         // check for error



Mime
View raw message