Author: cziegeler
Date: Tue Mar 29 11:53:32 2011
New Revision: 1086558
URL: http://svn.apache.org/viewvc?rev=1086558&view=rev
Log:
Fix typo and add some sanity locking.
Modified:
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/StatisticsImpl.java
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/LockManager.java
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/AbstractJobQueue.java
Modified:
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/StatisticsImpl.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/StatisticsImpl.java?rev=1086558&r1=1086557&r2=1086558&view=diff
==============================================================================
---
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/StatisticsImpl.java
(original)
+++
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/StatisticsImpl.java
Tue Mar 29 11:53:32 2011
@@ -242,19 +242,21 @@ public class StatisticsImpl implements S
* Create a new statistics object with exactly the same values.
*/
public synchronized void copyFrom(final StatisticsImpl other) {
- this.queuedJobs = other.queuedJobs;
- this.lastActivated = other.lastActivated;
- this.lastFinished = other.lastFinished;
- this.averageWaitingTime = other.averageWaitingTime;
- this.averageProcessingTime = other.averageProcessingTime;
- this.waitingTime = other.waitingTime;
- this.processingTime = other.processingTime;
- this.waitingCount = other.waitingCount;
- this.processingCount = other.processingCount;
- this.finishedJobs = other.finishedJobs;
- this.failedJobs = other.failedJobs;
- this.cancelledJobs = other.cancelledJobs;
- this.activeJobs = other.activeJobs;
+ synchronized ( other ) {
+ this.queuedJobs = other.queuedJobs;
+ this.lastActivated = other.lastActivated;
+ this.lastFinished = other.lastFinished;
+ this.averageWaitingTime = other.averageWaitingTime;
+ this.averageProcessingTime = other.averageProcessingTime;
+ this.waitingTime = other.waitingTime;
+ this.processingTime = other.processingTime;
+ this.waitingCount = other.waitingCount;
+ this.processingCount = other.processingCount;
+ this.finishedJobs = other.finishedJobs;
+ this.failedJobs = other.failedJobs;
+ this.cancelledJobs = other.cancelledJobs;
+ this.activeJobs = other.activeJobs;
+ }
}
/**
Modified:
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/LockManager.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/LockManager.java?rev=1086558&r1=1086557&r2=1086558&view=diff
==============================================================================
---
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/LockManager.java
(original)
+++
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/LockManager.java
Tue Mar 29 11:53:32 2011
@@ -49,7 +49,7 @@ import org.apache.sling.event.impl.suppo
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@Component(metatype=true,label="%lm.name",description="%jlm.description")
+@Component(metatype=true,label="%lm.name",description="%lm.description")
@Services({
@Service(value=Runnable.class),
@Service(value=LockManager.class)
Modified:
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/AbstractJobQueue.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/AbstractJobQueue.java?rev=1086558&r1=1086557&r2=1086558&view=diff
==============================================================================
---
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/AbstractJobQueue.java
(original)
+++
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/AbstractJobQueue.java
Tue Mar 29 11:53:32 2011
@@ -364,7 +364,7 @@ public abstract class AbstractJobQueue
}
protected boolean canBeMarkedForRemoval() {
- return this.isEmpty() && !this.isWaiting;
+ return this.isEmpty() && !this.isWaiting &&!this.isSuspended();
}
/**
* Mark this queue for removal.