You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2015/01/28 16:40:25 UTC
svn commit: r1655366 -
/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java
Author: cziegeler
Date: Wed Jan 28 15:40:25 2015
New Revision: 1655366
URL: http://svn.apache.org/r1655366
Log:
SLING-4361 : Minor code cleanup
Modified:
sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java
Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java?rev=1655366&r1=1655365&r2=1655366&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java (original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverFactoryActivator.java Wed Jan 28 15:40:25 2015
@@ -668,26 +668,24 @@ public class ResourceResolverFactoryActi
}
isRunning = !ops.contains(BG_OP.STOP);
- if ( isRunning ) {
- final int doUnregister = ops.lastIndexOf(BG_OP.UNREGISTER_AND_CHECK);
- if ( doUnregister != -1 ) {
- this.unregisterFactory();
- // we only delay between unregister and check
- // the delay is not really necessary but it provides
- // a smoother unregistration/registration cascade
- // and delaying for 2 secs should not hurt
- try {
- Thread.sleep(2000);
- } catch ( final InterruptedException ie ) {
- Thread.currentThread().interrupt();
- }
- ops.clear();
- synchronized ( this.coordinator ) {
- ops.addAll(this.operations);
- this.operations.clear();
- }
- isRunning = !ops.contains(BG_OP.STOP);
+ if ( isRunning && ops.lastIndexOf(BG_OP.UNREGISTER_AND_CHECK) != -1 ) {
+ this.unregisterFactory();
+ // we only delay between unregister and check
+ // the delay is not really necessary but it provides
+ // a smoother unregistration/registration cascade
+ // and delaying for 2 secs should not hurt
+ try {
+ Thread.sleep(2000);
+ } catch ( final InterruptedException ie ) {
+ Thread.currentThread().interrupt();
+ }
+ // check for new operations and simply ignore them (except for STOP)
+ ops.clear();
+ synchronized ( this.coordinator ) {
+ ops.addAll(this.operations);
+ this.operations.clear();
}
+ isRunning = !ops.contains(BG_OP.STOP);
}
if ( isRunning ) {