incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1242275 - /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
Date Thu, 09 Feb 2012 11:02:28 GMT
Author: cziegeler
Date: Thu Feb  9 11:02:27 2012
New Revision: 1242275

URL: http://svn.apache.org/viewvc?rev=1242275&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=1242275&r1=1242274&r2=1242275&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 11:02:27 2012
@@ -900,7 +900,14 @@ public class OsgiInstallerImpl
                 key = resourceType + ':' + resourceId;
                 final TaskResource tr = erl.getFirstResource();
                 if ( tr != null ) {
-                    if ( tr.getState() != ResourceState.IGNORED ) {
+                    if ( tr.getState() == ResourceState.IGNORED ) {
+                        // if it has been ignored before, we activate it now again!
+                        ((RegisteredResourceImpl)tr).setState(ResourceState.INSTALL);
+                        this.persistentList.save();
+                        this.scheduleRetry();
+                    } else if ( tr.getState() == ResourceState.UNINSTALLED ) {
+                        // it has already been removed - nothing do to
+                    } else {
                         final UpdateHandler handler = this.findHandler(tr.getScheme());
                         if ( handler == null ) {
                             // set to ignored
@@ -919,12 +926,9 @@ public class OsgiInstallerImpl
                                 ((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