incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1242261 - /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
Date Thu, 09 Feb 2012 10:21:34 GMT
Author: cziegeler
Date: Thu Feb  9 10:21:33 2012
New Revision: 1242261

URL: http://svn.apache.org/viewvc?rev=1242261&view=rev
Log:
SLING-2409 : If configuration is removed by config admin, state of provided artifact should
either be uninstalled or ignored

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java?rev=1242261&r1=1242260&r2=1242261&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
Thu Feb  9 10:21:33 2012
@@ -903,7 +903,9 @@ public class OsgiInstallerImpl
                     if ( tr.getState() != ResourceState.IGNORED ) {
                         final UpdateHandler handler = this.findHandler(tr.getScheme());
                         if ( handler == null ) {
+                            // set to ignored
                             logger.debug("No handler found to handle remove of resource with
scheme {}", tr.getScheme());
+                            ((RegisteredResourceImpl)tr).setState(ResourceState.IGNORED);
                         } else {
                             // we don't need to check the result, we just check if a result
is returned
                             if ( handler.handleRemoval(resourceType, resourceId, tr.getURL())
!= null ) {
@@ -911,18 +913,18 @@ public class OsgiInstallerImpl
                                 ((RegisteredResourceImpl)tr).setState(ResourceState.UNINSTALL);
                                 erl.setFinishState(ResourceState.UNINSTALLED);
                                 erl.compact();
-                                this.persistentList.save();
-                                this.scheduleRetry();
                             } else {
+                                // set to ignored
                                 logger.debug("No handler found to handle remove of resource
with scheme {}", tr.getScheme());
+                                ((RegisteredResourceImpl)tr).setState(ResourceState.IGNORED);
                             }
                         }
                     } else {
                         // if it has been ignored before, we activate it now again!
                         ((RegisteredResourceImpl)tr).setState(ResourceState.INSTALL);
-                        this.persistentList.save();
-                        this.scheduleRetry();
                     }
+                    this.persistentList.save();
+                    this.scheduleRetry();
                 }
             }
         }



Mime
View raw message