incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1364647 - in /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl: ./ tasks/
Date Mon, 23 Jul 2012 14:27:55 GMT
Author: cziegeler
Date: Mon Jul 23 14:27:54 2012
New Revision: 1364647

URL: http://svn.apache.org/viewvc?rev=1364647&view=rev
Log:
SLING-2525 : Improve internal task handling

Added:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RestartActiveBundlesTask.java
  (with props)
Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/AbstractInstallTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/AbstractBundleTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreator.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/InstallerBundleUpdateTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RefreshOptionalPackagesTask.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/AbstractInstallTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/AbstractInstallTask.java?rev=1364647&r1=1364646&r2=1364647&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/AbstractInstallTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/AbstractInstallTask.java
Mon Jul 23 14:27:54 2012
@@ -20,6 +20,10 @@ package org.apache.sling.installer.core.
 
 import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.TaskResourceGroup;
+import org.apache.sling.installer.core.impl.tasks.TaskSupport;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.service.startlevel.StartLevel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -30,11 +34,14 @@ public abstract class AbstractInstallTas
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
+    private final TaskSupport support;
+
     /**
      * Constructor
      */
-    public AbstractInstallTask(final TaskResourceGroup erl) {
+    public AbstractInstallTask(final TaskResourceGroup erl, final TaskSupport support) {
         super(erl);
+        this.support = support;
     }
 
     /**
@@ -43,4 +50,23 @@ public abstract class AbstractInstallTas
     protected Logger getLogger() {
         return this.logger;
     }
+
+    /**
+     * Get the bundle context.
+     */
+    protected BundleContext getBundleContext() {
+        return this.support.getBundleContext();
+    }
+
+    protected PackageAdmin getPackageAdmin() {
+        return this.support.getPackageAdmin();
+    }
+
+    protected StartLevel getStartLevel() {
+        return this.support.getStartLevel();
+    }
+
+    protected TaskSupport getTaskSupport() {
+        return this.support;
+    }
 }

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=1364647&r1=1364646&r2=1364647&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
Mon Jul 23 14:27:54 2012
@@ -200,8 +200,9 @@ public class OsgiInstallerImpl
         try {
             this.init();
 
+            this.listener.start();
             while (this.active) {
-                this.listener.start();
+                this.logger.debug("Running new installer cycle");
 
                 // merge potential new resources
                 this.mergeNewlyRegisteredResources();
@@ -209,6 +210,10 @@ public class OsgiInstallerImpl
                 // invoke transformers
                 this.transformResources();
 
+                // special resources
+                final EntityResourceList erl = this.persistentList.getEntityResourceList(PersistentResourceList.RESTART_ACTIVE_BUNDLES_ENTITY_ID
);
+                ((RegisteredResourceImpl)erl.getResources().iterator().next()).setState(ResourceState.INSTALL);
+
                 // Compute tasks
                 final SortedSet<InstallTask> tasks = this.computeTasks();
                 // execute tasks and see if we have to stop processing
@@ -229,7 +234,6 @@ public class OsgiInstallerImpl
                             } catch (final InterruptedException ignore) {}
                             if ( active ) {
                                 this.listener.start();
-                                this.logger.debug("Running new installer cycle");
                             }
                         }
                     }
@@ -1030,72 +1034,74 @@ public class OsgiInstallerImpl
             };
 
             for(final String entityId : this.persistentList.getEntityIds()) {
-                final EntityResourceList group = this.persistentList.getEntityResourceList(entityId);
-
-                final String alias = group.getAlias();
-                final List<Resource> resources = new ArrayList<Resource>();
-                for(final TaskResource tr : group.getResources()) {
-                    resources.add(new Resource() {
+                if ( !this.persistentList.isSpecialEntityId(entityId) ) {
+                    final EntityResourceList group = this.persistentList.getEntityResourceList(entityId);
 
-                        public String getScheme() {
-                            return tr.getScheme();
-                        }
+                    final String alias = group.getAlias();
+                    final List<Resource> resources = new ArrayList<Resource>();
+                    for(final TaskResource tr : group.getResources()) {
+                        resources.add(new Resource() {
 
-                        public String getURL() {
-                            return tr.getURL();
-                        }
+                            public String getScheme() {
+                                return tr.getScheme();
+                            }
 
-                        public String getType() {
-                            return tr.getType();
-                        }
+                            public String getURL() {
+                                return tr.getURL();
+                            }
 
-                        public InputStream getInputStream() throws IOException {
-                            return tr.getInputStream();
-                        }
+                            public String getType() {
+                                return tr.getType();
+                            }
 
-                        public Dictionary<String, Object> getDictionary() {
-                            return tr.getDictionary();
-                        }
+                            public InputStream getInputStream() throws IOException {
+                                return tr.getInputStream();
+                            }
 
-                        public String getDigest() {
-                            return tr.getDigest();
-                        }
+                            public Dictionary<String, Object> getDictionary() {
+                                return tr.getDictionary();
+                            }
 
-                        public int getPriority() {
-                            return tr.getPriority();
-                        }
+                            public String getDigest() {
+                                return tr.getDigest();
+                            }
 
-                        public String getEntityId() {
-                            return tr.getEntityId();
-                        }
+                            public int getPriority() {
+                                return tr.getPriority();
+                            }
 
-                        public ResourceState getState() {
-                            return tr.getState();
-                        }
+                            public String getEntityId() {
+                                return tr.getEntityId();
+                            }
 
-                        public Version getVersion() {
-                            return tr.getVersion();
-                        }
+                            public ResourceState getState() {
+                                return tr.getState();
+                            }
 
-                        public long getLastChange() {
-                            return ((RegisteredResourceImpl)tr).getLastChange();
-                        }
-                    });
-                }
-                final ResourceGroup rg = new ResourceGroup() {
+                            public Version getVersion() {
+                                return tr.getVersion();
+                            }
 
-                    public List<Resource> getResources() {
-                        return resources;
+                            public long getLastChange() {
+                                return ((RegisteredResourceImpl)tr).getLastChange();
+                            }
+                        });
                     }
+                    final ResourceGroup rg = new ResourceGroup() {
+
+                        public List<Resource> getResources() {
+                            return resources;
+                        }
 
-                    public String getAlias() {
-                        return alias;
+                        public String getAlias() {
+                            return alias;
+                        }
+                    };
+                    if ( group.getActiveResource() != null ) {
+                        state.getActiveResources().add(rg);
+                    } else {
+                        state.getInstalledResources().add(rg);
                     }
-                };
-                if ( group.getActiveResource() != null ) {
-                    state.getActiveResources().add(rg);
-                } else {
-                    state.getInstalledResources().add(rg);
                 }
             }
 

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java?rev=1364647&r1=1364646&r2=1364647&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java
Mon Jul 23 14:27:54 2012
@@ -29,6 +29,7 @@ import java.io.ObjectOutputStream;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -50,6 +51,11 @@ public class PersistentResourceList {
     /** Serialization version. */
     private static final int VERSION = 2;
 
+    /** Entity id for restart active bundles. */
+    public static final String RESTART_ACTIVE_BUNDLES_TYPE = "org.apache.sling.installer.core.restart.bundles";
+    public static final String RESTART_ACTIVE_BUNDLES_ID = "org.apache.sling.installer.core.restart.bundles";
+    public static final String RESTART_ACTIVE_BUNDLES_ENTITY_ID = RESTART_ACTIVE_BUNDLES_TYPE
+ ':' + RESTART_ACTIVE_BUNDLES_ID;
+
     /** The logger */
     private final Logger logger =  LoggerFactory.getLogger(this.getClass());
 
@@ -113,6 +119,20 @@ public class PersistentResourceList {
             entry.getValue().setResourceId(entry.getKey());
             entry.getValue().setListener(listener);
         }
+
+        // check for special resources
+        if ( this.getEntityResourceList(RESTART_ACTIVE_BUNDLES_ENTITY_ID) == null ) {
+            final RegisteredResource rr = this.addOrUpdate(new InternalResource("$sling-installer$",
+                            RESTART_ACTIVE_BUNDLES_ID,
+                            null,
+                            new Hashtable<String, Object>(),
+                            InstallableResource.TYPE_PROPERTIES, "1",
+                            null, null, null));
+            final TransformationResult result = new TransformationResult();
+            result.setId(RESTART_ACTIVE_BUNDLES_ID);
+            result.setResourceType(RESTART_ACTIVE_BUNDLES_TYPE);
+            this.transform(rr, new TransformationResult[] {result});
+        }
     }
 
     /**
@@ -314,4 +334,10 @@ public class PersistentResourceList {
         }
     }
 
+    /**
+     * Check if the id is a special id and should not be included in the info report
+     */
+    public boolean isSpecialEntityId(final String id) {
+        return RESTART_ACTIVE_BUNDLES_ENTITY_ID.equals(id);
+    }
 }

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/AbstractBundleTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/AbstractBundleTask.java?rev=1364647&r1=1364646&r2=1364647&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/AbstractBundleTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/AbstractBundleTask.java
Mon Jul 23 14:27:54 2012
@@ -21,36 +21,14 @@ package org.apache.sling.installer.core.
 import org.apache.sling.installer.api.InstallableResource;
 import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.apache.sling.installer.core.impl.AbstractInstallTask;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.service.startlevel.StartLevel;
 
 /**
  * Abstract base class for bundle related tasks.
  */
 public abstract class AbstractBundleTask extends AbstractInstallTask {
 
-    private final TaskSupport support;
-
     public AbstractBundleTask(final TaskResourceGroup erl, final TaskSupport support) {
-        super(erl);
-        this.support = support;
-    }
-
-    protected PackageAdmin getPackageAdmin() {
-        return this.support.getPackageAdmin();
-    }
-
-    protected BundleContext getBundleContext() {
-        return this.support.getBundleContext();
-    }
-
-    protected StartLevel getStartLevel() {
-        return this.support.getStartLevel();
-    }
-
-    protected TaskSupport getTaskSupport() {
-        return this.support;
+        super(erl, support);
     }
 
     /**

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreator.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreator.java?rev=1364647&r1=1364646&r2=1364647&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreator.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreator.java
Mon Jul 23 14:27:54 2012
@@ -28,6 +28,7 @@ import org.apache.sling.installer.api.ta
 import org.apache.sling.installer.api.tasks.TaskResource;
 import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.apache.sling.installer.core.impl.InternalService;
+import org.apache.sling.installer.core.impl.PersistentResourceList;
 import org.apache.sling.installer.core.impl.Util;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleEvent;
@@ -125,6 +126,9 @@ public class BundleTaskCreator
 	public InstallTask createTask(final TaskResourceGroup resourceList) {
 	    // quick check of the resource type.
 	    final TaskResource toActivate = resourceList.getActiveResource();
+	    if ( toActivate.getType().equals(PersistentResourceList.RESTART_ACTIVE_BUNDLES_TYPE)
) {
+	        return new RestartActiveBundlesTask(resourceList, this.taskSupport);
+	    }
 	    if ( !toActivate.getType().equals(InstallableResource.TYPE_BUNDLE) ) {
 	        return null;
 	    }

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/InstallerBundleUpdateTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/InstallerBundleUpdateTask.java?rev=1364647&r1=1364646&r2=1364647&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/InstallerBundleUpdateTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/InstallerBundleUpdateTask.java
Mon Jul 23 14:27:54 2012
@@ -32,14 +32,11 @@ public class InstallerBundleUpdateTask e
 
     private static final String BUNDLE_UPDATE_ORDER = "02-";
 
-    private final TaskSupport taskSupport;
-
     private final Integer count;
 
     public InstallerBundleUpdateTask(final TaskResourceGroup r,
                                      final TaskSupport taskSupport) {
-        super(r);
-        this.taskSupport = taskSupport;
+        super(r, taskSupport);
         this.count = (Integer)this.getResource().getAttribute(InstallTask.ASYNC_ATTR_NAME);
     }
 
@@ -47,7 +44,7 @@ public class InstallerBundleUpdateTask e
      * @see org.apache.sling.installer.api.tasks.InstallTask#execute(org.apache.sling.installer.api.tasks.InstallationContext)
      */
     public void execute(final InstallationContext ctx) {
-        final Bundle b = this.taskSupport.getBundleContext().getBundle();
+        final Bundle b = this.getBundleContext().getBundle();
         if ( this.count == null ) {
             // first step: update bundle
 
@@ -61,7 +58,7 @@ public class InstallerBundleUpdateTask e
             }
         } else if ( this.count == 1 ) {
             // second step: refresh
-            this.taskSupport.getPackageAdmin().refreshPackages(new Bundle[] {b});
+            this.getPackageAdmin().refreshPackages(new Bundle[] {b});
         } else {
             // finished
             this.getResource().setAttribute(ASYNC_ATTR_NAME, null);

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RefreshOptionalPackagesTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RefreshOptionalPackagesTask.java?rev=1364647&r1=1364646&r2=1364647&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RefreshOptionalPackagesTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RefreshOptionalPackagesTask.java
Mon Jul 23 14:27:54 2012
@@ -40,12 +40,8 @@ public class RefreshOptionalPackagesTask
     private static final String DIRECTIVE_OPTIONAL = "optional";
     private static final String MARKER = DIRECTIVE + ":=" + DIRECTIVE_OPTIONAL;
 
-    /** Tracker for the package admin. */
-    private final TaskSupport taskSupport;
-
 	public RefreshOptionalPackagesTask(final TaskSupport taskSupport) {
-	    super(null);
-	    this.taskSupport = taskSupport;
+	    super(null, taskSupport);
 	}
 
 	@Override
@@ -63,11 +59,11 @@ public class RefreshOptionalPackagesTask
      */
     public void execute(final InstallationContext ctx) {
         getLogger().info("** Invoking refresh optional packages!");
-        final PackageAdmin packageAdmin = this.taskSupport.getPackageAdmin();
+        final PackageAdmin packageAdmin = this.getPackageAdmin();
 
         ExportedPackage[] exports = null;
         final List<Bundle> refreshBundles = new ArrayList<Bundle>();
-        final Bundle[] bundles = this.taskSupport.getBundleContext().getBundles();
+        final Bundle[] bundles = this.getBundleContext().getBundles();
         for(final Bundle bundle : bundles) {
             if ( bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.ACTIVE
) {
                 final String importHeader = (String)bundle.getHeaders().get(Constants.IMPORT_PACKAGE);

Added: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RestartActiveBundlesTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RestartActiveBundlesTask.java?rev=1364647&view=auto
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RestartActiveBundlesTask.java
(added)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RestartActiveBundlesTask.java
Mon Jul 23 14:27:54 2012
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.installer.core.impl.tasks;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.sling.installer.api.tasks.InstallationContext;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
+import org.apache.sling.installer.core.impl.AbstractInstallTask;
+import org.apache.sling.installer.core.impl.PersistentResourceList;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * Restart all active bundles.
+ * This task is added to each installer cycle.
+ */
+public class RestartActiveBundlesTask extends AbstractInstallTask {
+
+    private static final String SORT_KEY = "99-" + PersistentResourceList.RESTART_ACTIVE_BUNDLES_ID;
+
+    private static final String ATTR = "bundles";
+
+    /**
+     * Constructor
+     */
+    public RestartActiveBundlesTask(final TaskResourceGroup erl, final TaskSupport support)
{
+        super(erl, support);
+        // calculate bundle set
+        @SuppressWarnings("unchecked")
+        Set<Long> ids = (Set<Long>) erl.getActiveResource().getAttribute(ATTR);
+        if ( ids == null ) {
+            ids = new HashSet<Long>();
+        }
+        for(final Bundle bundle : support.getBundleContext().getBundles()) {
+            if ( bundle.getBundleId() > 0 && BundleUtil.getFragmentHostHeader(bundle)
== null && bundle.getState() == Bundle.ACTIVE ) {
+                ids.add(bundle.getBundleId());
+            }
+        }
+        erl.getActiveResource().setAttribute(ATTR, ids);
+    }
+
+    @Override
+    public void execute(final InstallationContext ctx) {
+        @SuppressWarnings("unchecked")
+        final Set<Long> ids = (Set<Long>) this.getResource().getAttribute(ATTR);
+        if ( ids != null ) {
+            final Set<Long> remove = new HashSet<Long>();
+            for(final Long id : ids) {
+                final Bundle bundle = this.getBundleContext().getBundle(id);
+                if ( bundle != null
+                     && bundle.getState() != Bundle.ACTIVE
+                     && bundle.getState() != Bundle.STARTING
+                     && bundle.getState() != Bundle.STOPPING
+                     && bundle.getState() != Bundle.UNINSTALLED) {
+                    try {
+                        bundle.start();
+                        remove.add(id);
+                    } catch (final BundleException e) {
+                        ctx.log("Unable to start bundle: {}", e.getMessage());
+                    }
+                } else {
+                    remove.add(id);
+                }
+            }
+            ids.removeAll(remove);
+        }
+    }
+
+    @Override
+    public String getSortKey() {
+        return SORT_KEY;
+    }
+}

Propchange: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RestartActiveBundlesTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RestartActiveBundlesTask.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Propchange: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/RestartActiveBundlesTask.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=1364647&r1=1364646&r2=1364647&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 Jul 23 14:27:54 2012
@@ -37,17 +37,14 @@ public class SystemBundleUpdateTask exte
 
     private static final String SYSTEM_BUNDLE_UPDATE_ORDER = BUNDLE_UPDATE_ORDER + "systembundle(0)";
 
-    private final TaskSupport taskSupport;
-
     public SystemBundleUpdateTask(final TaskResourceGroup r,
             final TaskSupport taskSupport) {
-        super(r);
-        this.taskSupport = taskSupport;
+        super(r, taskSupport);
     }
 
     @Override
     public void execute(final InstallationContext ctx) {
-        final Bundle systemBundle = this.taskSupport.getBundleContext().getBundle(0);
+        final Bundle systemBundle = this.getBundleContext().getBundle(0);
         // sanity check
         if ( systemBundle == null ) {
             this.setFinishedState(ResourceState.IGNORED);



Mime
View raw message