incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1408343 - in /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks: BundleInstallTask.java SystemBundleUpdateTask.java
Date Mon, 12 Nov 2012 16:29:40 GMT
Author: cziegeler
Date: Mon Nov 12 16:29:39 2012
New Revision: 1408343

URL: http://svn.apache.org/viewvc?rev=1408343&view=rev
Log:
SLING-2659 :  System Fragment Installation should not call update on the framework 

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleInstallTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SystemBundleUpdateTask.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleInstallTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleInstallTask.java?rev=1408343&r1=1408342&r2=1408343&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleInstallTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleInstallTask.java
Mon Nov 12 16:29:39 2012
@@ -40,6 +40,7 @@ public class BundleInstallTask extends A
     /**
      * @see org.apache.sling.installer.api.tasks.InstallTask#execute(org.apache.sling.installer.api.tasks.InstallationContext)
      */
+    @Override
     public void execute(final InstallationContext ctx) {
         final int startLevel = this.getBundleStartLevel();
         try {
@@ -60,8 +61,9 @@ public class BundleInstallTask extends A
 
             // fragment?
             if ( BundleUtil.isSystemBundleFragment(b) ) {
+                // first install of a system fragment does not need a refresh of the host
+                // so we can just set the state and are done.
                 this.setFinishedState(ResourceState.INSTALLED);
-                ctx.addTaskToCurrentCycle(new SystemBundleUpdateTask(null, this.getTaskSupport()));
             } else {
                 final String fragmentHostHeader = BundleUtil.getFragmentHostHeader(b);
                 if (fragmentHostHeader != null) {

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SystemBundleUpdateTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SystemBundleUpdateTask.java?rev=1408343&r1=1408342&r2=1408343&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SystemBundleUpdateTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SystemBundleUpdateTask.java
Mon Nov 12 16:29:39 2012
@@ -20,6 +20,7 @@ package org.apache.sling.installer.core.
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Collections;
 
 import org.apache.sling.installer.api.tasks.InstallationContext;
 import org.apache.sling.installer.api.tasks.ResourceState;
@@ -54,14 +55,8 @@ public class SystemBundleUpdateTask exte
 
         // restart system bundle
         if ( this.getResource() == null ) {
-            try {
-                systemBundle.update();
-                ctx.log("Updated system bundle.");
-            } catch (final BundleException e) {
-                getLogger().warn("Updating system bundle failed - unable to retry: " + this,
e);
-                this.setFinishedState(ResourceState.IGNORED);
-                ctx.asyncTaskFailed(this);
-            }
+            ctx.log("Refreshing system bundle.");
+            this.getBundleRefresher().refreshBundles(ctx, Collections.singletonList(systemBundle),
false);
         } else {
             InputStream is = null;
             try {



Mime
View raw message