incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1060001 - in /sling/trunk/installer/core/src: main/java/org/apache/sling/installer/api/ main/java/org/apache/sling/installer/api/tasks/ main/java/org/apache/sling/installer/core/impl/ main/java/org/apache/sling/installer/core/impl/config/ ...
Date Mon, 17 Jan 2011 17:16:51 GMT
Author: cziegeler
Date: Mon Jan 17 17:16:50 2011
New Revision: 1060001

URL: http://svn.apache.org/viewvc?rev=1060001&view=rev
Log:
Add some more javadocs and clean up abstract task: it should not expose the internally used
logging api.

Added:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/AbstractInstallTask.java
  (with props)
Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/InstallableResource.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTaskFactory.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallationContext.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResource.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceState.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceTransformer.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResource.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.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/RegisteredResourceImpl.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/AbstractConfigTask.java
    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/BundleRemoveTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleStartTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleUpdateTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SynchronousRefreshPackagesTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SystemBundleUpdateTask.java
    sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java
    sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreatorTest.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/InstallableResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/InstallableResource.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/InstallableResource.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/InstallableResource.java
Mon Jan 17 17:16:50 2011
@@ -24,7 +24,9 @@ import java.util.Dictionary;
 
 /**
  * A piece of data that can be installed by the {@link OsgiInstaller}
- * Currently the OSGi installer supports bundles and configurations.
+ * Currently the OSGi installer supports bundles and configurations,
+ * but it can be extended by additional task factories supporting
+ * other formats.
  *
  * The installable resource contains as much information as the client
  * can provide. An input stream or dictionary is mandatory everything
@@ -32,24 +34,46 @@ import java.util.Dictionary;
  * by the OSGi installer. If such evaluation fails the resource will
  * be ignore during installation.
  *
+ * If the client provides a configuration it should use the
+ * resource type {@link #TYPE_PROPERTIES}. Otherwise the resource
+ * type {@link #TYPE_FILE} should be used. These two generic types
+ * are transformed by resource transformer services to the appropriate
+ * resource type like bundle or configuration etc. This frees the
+ * client from having any knowledge about the provided data.
+ * However, if the client has the knowledge about the data it can
+ * provided a specific resource type.
  */
 public class InstallableResource {
 
-    /** @since 3.1 */
+    /**
+     * The type for properties - in this case {@link #getDictionary()}
+     * should contain a dictionary or the {@link #getInputStream()}
+     * should point to a property or configuration file.
+     * @since 3.1 */
     public static final String TYPE_PROPERTIES = "properties";
-    /** @since 3.1 */
+
+    /**
+     * The type for all other provided data like a bundle etc.
+     * In this case {@link #getInputStream()} must return an input
+     * stream to the data. {@link #getDictionary()} might return
+     * additional information.
+     * @since 3.1 */
     public static final String TYPE_FILE = "file";
 
     /**
      * The type for a bundle - in this case {@link #getInputStream} must
      * return an input stream to the bundle. {@link #getDictionary()} might
      * return additional information.
+     * This type should only be used if the client really knows that the
+     * provided data is a bundle.
      */
     public static final String TYPE_BUNDLE = "bundle";
 
     /**
      * The type for a configuration - in this case {@link #getDictionary()}
      * must return a dictionary with the configuration.
+     * This type should only be used if the client really knows that the
+     * provided data is an OSGi configuration.
      */
     public static final String TYPE_CONFIG = "config";
 
@@ -72,7 +96,7 @@ public class InstallableResource {
     /**
      * Create a data object - this is a simple constructor just using the
      * values as they are provided.
-     * @param id Unique id for the resource, For auto detection if the resource
+     * @param id Unique id for the resource, For auto detection of the resource
      *           type, the id should contain an extension like .jar, .cfg etc.
      * @param is The input stream to the data or
      * @param dict A dictionary with data

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTask.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTask.java
Mon Jan 17 17:16:50 2011
@@ -18,20 +18,19 @@
  */
 package org.apache.sling.installer.api.tasks;
 
-import org.apache.sling.installer.core.impl.OsgiInstallerImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
 /**
- * Base class for tasks that can be executed by the {@link OsgiInstallerImpl}
+ * Base class for tasks that can be executed by the
+ * {@link org.apache.sling.installer.api.OsgiInstaller}.
  */
 public abstract class InstallTask implements Comparable<InstallTask> {
 
+    /** The resource group this task is working on. */
     private final TaskResourceGroup resourceGroup;
 
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());
-
+    /**
+     * Constructor for the task
+     * @param erl The resource group or <code>null</code>.
+     */
     public InstallTask(final TaskResourceGroup erl) {
         this.resourceGroup = erl;
     }
@@ -53,22 +52,28 @@ public abstract class InstallTask implem
         return this.resourceGroup;
     }
 
-    public Logger getLogger() {
-        return this.logger;
-    }
-
+    /**
+     * This is the heart of the task - it performs the actual task.
+     * @param ctx The installation context.
+     */
     public abstract void execute(InstallationContext ctx);
 
-	/** Tasks are sorted according to this key */
+	/**
+	 * Tasks are sorted according to this key.
+	 * Therefore this key must uniquely identify this task.
+	 * A typical sort key contains the entity id of the resource
+	 * in execution.
+	 */
 	public abstract String getSortKey();
 
-	/** All comparisons are based on getSortKey() */
-	public final int compareTo(InstallTask o) {
-		return getSortKey().compareTo(o.getSortKey());
-	}
-
+	/**
+	 * Set the finished state for the resource.
+	 * @param state The new state.
+	 */
 	public void setFinishedState(final ResourceState state) {
-	    this.resourceGroup.setFinishState(state);
+	    if ( this.resourceGroup != null ) {
+	        this.resourceGroup.setFinishState(state);
+	    }
 	}
 
     @Override
@@ -88,4 +93,11 @@ public abstract class InstallTask implem
 	public final int hashCode() {
 		return getSortKey().hashCode();
 	}
+
+    /**
+     * All comparisons are based on getSortKey().
+     */
+    public final int compareTo(InstallTask o) {
+        return getSortKey().compareTo(o.getSortKey());
+    }
 }
\ No newline at end of file

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTaskFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTaskFactory.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTaskFactory.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallTaskFactory.java
Mon Jan 17 17:16:50 2011
@@ -18,6 +18,13 @@
  */
 package org.apache.sling.installer.api.tasks;
 
+/**
+ * The install task factory creates a task for a given
+ * resource.
+ * An install task factory is a plugin service that
+ * checks a resource if it is installable by this plugin
+ * and creates an appropriate task.
+ */
 public interface InstallTaskFactory {
 
     /**

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallationContext.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallationContext.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallationContext.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/InstallationContext.java
Mon Jan 17 17:16:50 2011
@@ -18,21 +18,30 @@
  */
 package org.apache.sling.installer.api.tasks;
 
-
 /**
  * Context for the installation tasks.
- * Currently it allows to add a task to the current or the next cycle.
+ *
+ * The context is passed into an {@link InstallTask} during
+ * execution of a task. The task can schedule tasks to the
+ * current or next execution cycle.
+ *
+ * In addition access to an audit log is provided. The task
+ * should make an entry into the log each time a task has
+ * succeeded like something has been installed, updated or
+ * deleted.
  */
 public interface InstallationContext {
 
 	/**
-	 * Schedule a task for execution in the current OsgiController cycle
+	 * Schedule a task for execution in the current cycle.
 	 */
 	void addTaskToCurrentCycle(InstallTask t);
 
 	/**
-	 * Schedule a task for execution in the next OsgiController cycle,
+	 * Schedule a task for execution in the next cycle,
 	 * usually to indicate that a task must be retried
+	 * or the current task is finished and another task
+	 * has to be run.
 	 */
 	void addTaskToNextCycle(InstallTask t);
 

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResource.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResource.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResource.java
Mon Jan 17 17:16:50 2011
@@ -25,6 +25,7 @@ import java.util.Dictionary;
 /**
  * A resource that's been registered in the OSGi controller.
  * Data can be either an input stream or a dictionary.
+ * Registered resources are processed by a {@link ResourceTransformer}.
  */
 public interface RegisteredResource {
 
@@ -50,8 +51,8 @@ public interface RegisteredResource {
      * Return an input stream with the data of this resource.
      * Null if resource contains a configuration instead. Caller is responsible for
      * closing the stream.
-     * If this resource is of type CONFIG it must not return an input stream and
-     * if this resource is of type BUNDLE it must return an input stream!
+     * If this resource is of type PROPERTIES it must not return an input stream and
+     * if this resource is of type FILE it must return an input stream!
      * @return The input stream or null.
      */
     InputStream getInputStream() throws IOException;
@@ -59,7 +60,7 @@ public interface RegisteredResource {
     /**
      * Return this resource's dictionary.
      * Null if resource contains an InputStream instead. If this resource is of
-     * type CONFIG it must return a dictionary and if this resource is of type BUNDLE
+     * type PROPERTIES it must return a dictionary and if this resource is of type FILE
      * it might return a dictionary!
      * @return The resource's dictionary or null.
      */

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceState.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceState.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceState.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceState.java
Mon Jan 17 17:16:50 2011
@@ -18,11 +18,14 @@
  */
 package org.apache.sling.installer.api.tasks;
 
+/**
+ * The state of a resource.
+ */
 public enum ResourceState {
 
-        INSTALL,
-        UNINSTALL,
-        INSTALLED,
-        UNINSTALLED,
-        IGNORED
+        INSTALL,        // the resource should be installed
+        UNINSTALL,      // the resource should be uninstalled
+        INSTALLED,      // the resource is installed
+        UNINSTALLED,    // the resource is uninstalled
+        IGNORED         // the resource has been ignored
 }

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceTransformer.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceTransformer.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceTransformer.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/ResourceTransformer.java
Mon Jan 17 17:16:50 2011
@@ -19,8 +19,11 @@
 package org.apache.sling.installer.api.tasks;
 
 /**
- * A resource transformer might transform a registered resource
- * before it is installed.
+ * A resource transformer transform a registered resource
+ * before it can be installed.
+ * Based on the transformation result, the installer creates
+ * one or more {@link TaskResource}s from the registered
+ * resources and passes them on to the {@link InstallTaskFactory}.
  */
 public interface ResourceTransformer {
 

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResource.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResource.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResource.java
Mon Jan 17 17:16:50 2011
@@ -47,11 +47,6 @@ public interface TaskResource extends Re
     ResourceState getState();
 
     /**
-     * Set the new state of teh resource.
-     */
-    void setState(final ResourceState s);
-
-    /**
      * Get the value of a temporary attribute.
      * @param key The name of the attribute
      * @return The value of the attribute or <code>null</code>

Added: 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=1060001&view=auto
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/AbstractInstallTask.java
(added)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/AbstractInstallTask.java
Mon Jan 17 17:16:50 2011
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+import org.apache.sling.installer.api.tasks.InstallTask;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractInstallTask extends InstallTask {
+
+    public AbstractInstallTask(TaskResourceGroup erl) {
+        super(erl);
+    }
+
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    protected Logger getLogger() {
+        return this.logger;
+    }
+
+}

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

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

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

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.java
Mon Jan 17 17:16:50 2011
@@ -28,9 +28,9 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 
 import org.apache.sling.installer.api.tasks.RegisteredResource;
-import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.apache.sling.installer.api.tasks.ResourceState;
 import org.apache.sling.installer.api.tasks.TaskResource;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -125,18 +125,18 @@ public class EntityResourceList implemen
                     // first resource got uninstalled, go back to second
                     if (second.getState() == ResourceState.IGNORED || second.getState() ==
ResourceState.INSTALLED) {
                         LOGGER.debug("Reactivating for next cycle: {}", second);
-                        second.setState(ResourceState.INSTALL);
+                        ((RegisteredResourceImpl)second).setState(ResourceState.INSTALL);
                     }
                 } else {
                     // don't install as the first did not get uninstalled
                     if ( second.getState() == ResourceState.INSTALL ) {
-                        second.setState(ResourceState.IGNORED);
+                        ((RegisteredResourceImpl)second).setState(ResourceState.IGNORED);
                     }
                     // and now set resource to uninstalled
                     state = ResourceState.UNINSTALLED;
                 }
             }
-            toActivate.setState(state);
+            ((RegisteredResourceImpl)toActivate).setState(state);
             if ( state == ResourceState.UNINSTALLED ) {
                 this.cleanup(toActivate);
             }
@@ -164,7 +164,7 @@ public class EntityResourceList implemen
                 this.cleanup(rr);
                 resources.remove(rr);
                 if ( first && rr.equals(r) ) {
-                    r.setState(rr.getState());
+                    ((RegisteredResourceImpl)r).setState(rr.getState());
                 }
                 break;
             }
@@ -182,7 +182,7 @@ public class EntityResourceList implemen
                 if ( first && (r.getState() == ResourceState.INSTALLED
                         || r.getState() == ResourceState.INSTALL)) {
                     LOGGER.debug("Marking for uninstalling: {}", r);
-                    r.setState(ResourceState.UNINSTALL);
+                    ((RegisteredResourceImpl)r).setState(ResourceState.UNINSTALL);
                 } else {
                     LOGGER.debug("Removing unused: {}", r);
                     i.remove();

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=1060001&r1=1060000&r2=1060001&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 Jan 17 17:16:50 2011
@@ -38,10 +38,10 @@ import org.apache.sling.installer.api.ta
 import org.apache.sling.installer.api.tasks.InstallTaskFactory;
 import org.apache.sling.installer.api.tasks.InstallationContext;
 import org.apache.sling.installer.api.tasks.RegisteredResource;
-import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.apache.sling.installer.api.tasks.ResourceState;
 import org.apache.sling.installer.api.tasks.ResourceTransformer;
 import org.apache.sling.installer.api.tasks.TaskResource;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.apache.sling.installer.api.tasks.TransformationResult;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleEvent;
@@ -362,7 +362,7 @@ public class OsgiInstallerImpl
                                 logger.debug("Resource {} seems to be removed.", r);
                                 if ( first && (r.getState() == ResourceState.INSTALLED
                                            ||  r.getState() == ResourceState.INSTALL) ) {
-                                     r.setState(ResourceState.UNINSTALL);
+                                    ((RegisteredResourceImpl)r).setState(ResourceState.UNINSTALL);
                                 } else {
                                     toRemove.add(r);
                                 }

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java
Mon Jan 17 17:16:50 2011
@@ -276,7 +276,7 @@ public class RegisteredResourceImpl
     }
 
     /**
-     * @see org.apache.sling.installer.api.tasks.TaskResource#setState(org.apache.sling.installer.api.tasks.ResourceState)
+     *Set the state for the resource.
      */
     public void setState(ResourceState s) {
         this.state = s;

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/AbstractConfigTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/AbstractConfigTask.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/AbstractConfigTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/AbstractConfigTask.java
Mon Jan 17 17:16:50 2011
@@ -25,8 +25,8 @@ import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Set;
 
-import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.TaskResourceGroup;
+import org.apache.sling.installer.core.impl.AbstractInstallTask;
 import org.osgi.framework.Constants;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.cm.Configuration;
@@ -36,7 +36,7 @@ import org.osgi.util.tracker.ServiceTrac
 /**
  * Base class for configuration-related tasks
  */
-abstract class AbstractConfigTask extends InstallTask {
+abstract class AbstractConfigTask extends AbstractInstallTask {
 
     /** Configuration properties to ignore when comparing configs */
     protected static final Set<String> ignoredProperties = new HashSet<String>();

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=1060001&r1=1060000&r2=1060001&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 Jan 17 17:16:50 2011
@@ -19,15 +19,15 @@
 package org.apache.sling.installer.core.impl.tasks;
 
 import org.apache.sling.installer.api.InstallableResource;
-import org.apache.sling.installer.api.tasks.InstallTask;
 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.osgi.framework.Bundle;
 import org.osgi.service.startlevel.StartLevel;
 
 /** Install a bundle supplied as a RegisteredResource.
  *  Creates a BundleStartTask to start the bundle */
-public class BundleInstallTask extends InstallTask {
+public class BundleInstallTask extends AbstractInstallTask {
 
     private static final String BUNDLE_INSTALL_ORDER = "50-";
 

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleRemoveTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleRemoveTask.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleRemoveTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleRemoveTask.java
Mon Jan 17 17:16:50 2011
@@ -18,10 +18,10 @@
  */
 package org.apache.sling.installer.core.impl.tasks;
 
-import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.InstallationContext;
 import org.apache.sling.installer.api.tasks.ResourceState;
 import org.apache.sling.installer.api.tasks.TaskResourceGroup;
+import org.apache.sling.installer.core.impl.AbstractInstallTask;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
@@ -30,7 +30,7 @@ import org.osgi.framework.Constants;
  *  Creates a SynchronousRefreshPackagesTask when
  *  executed.
  */
-public class BundleRemoveTask extends InstallTask {
+public class BundleRemoveTask extends AbstractInstallTask {
 
     private static final String BUNDLE_REMOVE_ORDER = "30-";
 

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleStartTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleStartTask.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleStartTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleStartTask.java
Mon Jan 17 17:16:50 2011
@@ -20,11 +20,11 @@ package org.apache.sling.installer.core.
 
 import java.text.DecimalFormat;
 
-import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.InstallationContext;
 import org.apache.sling.installer.api.tasks.ResourceState;
 import org.apache.sling.installer.api.tasks.TaskResource;
 import org.apache.sling.installer.api.tasks.TaskResourceGroup;
+import org.apache.sling.installer.core.impl.AbstractInstallTask;
 import org.apache.sling.installer.core.impl.OsgiInstallerImpl;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
@@ -35,7 +35,7 @@ import org.osgi.framework.Constants;
  *  but only after receiving a bundle or framework event,
  *  indicating that it's worth retrying
  */
-public class BundleStartTask extends InstallTask {
+public class BundleStartTask extends AbstractInstallTask {
 
     private static final String BUNDLE_START_ORDER = "70-";
 

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleUpdateTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleUpdateTask.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleUpdateTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/BundleUpdateTask.java
Mon Jan 17 17:16:50 2011
@@ -18,10 +18,10 @@
  */
 package org.apache.sling.installer.core.impl.tasks;
 
-import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.InstallationContext;
 import org.apache.sling.installer.api.tasks.ResourceState;
 import org.apache.sling.installer.api.tasks.TaskResourceGroup;
+import org.apache.sling.installer.core.impl.AbstractInstallTask;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
@@ -30,7 +30,7 @@ import org.osgi.framework.Version;
  *  a bundleStartTask to restart the bundle if it was
  *   active before the update.
  */
-public class BundleUpdateTask extends InstallTask {
+public class BundleUpdateTask extends AbstractInstallTask {
 
     private static final String BUNDLE_UPDATE_ORDER = "40-";
 

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SynchronousRefreshPackagesTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SynchronousRefreshPackagesTask.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SynchronousRefreshPackagesTask.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/SynchronousRefreshPackagesTask.java
Mon Jan 17 17:16:50 2011
@@ -18,15 +18,16 @@
  */
 package org.apache.sling.installer.core.impl.tasks;
 
-import org.apache.sling.installer.api.tasks.InstallationContext;
 import org.apache.sling.installer.api.tasks.InstallTask;
+import org.apache.sling.installer.api.tasks.InstallationContext;
+import org.apache.sling.installer.core.impl.AbstractInstallTask;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.FrameworkEvent;
 import org.osgi.framework.FrameworkListener;
 import org.osgi.service.packageadmin.PackageAdmin;
 
 /** Execute an OSGi "refresh packages" operation, synchronously */
-public class SynchronousRefreshPackagesTask extends InstallTask implements FrameworkListener
{
+public class SynchronousRefreshPackagesTask extends AbstractInstallTask implements FrameworkListener
{
 
     /** Tracker for the package admin. */
     private final BundleTaskCreator bundleTaskCreator;

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=1060001&r1=1060000&r2=1060001&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 Jan 17 17:16:50 2011
@@ -21,9 +21,9 @@ package org.apache.sling.installer.core.
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.sling.installer.api.tasks.InstallTask;
 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.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
@@ -31,7 +31,7 @@ import org.osgi.framework.Constants;
 /**
  * Update the system bundle from a RegisteredResource.
  */
-public class SystemBundleUpdateTask extends InstallTask {
+public class SystemBundleUpdateTask extends AbstractInstallTask {
 
     private static final String BUNDLE_UPDATE_ORDER = "99-";
 

Modified: sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java
(original)
+++ sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/MockBundleResource.java
Mon Jan 17 17:16:50 2011
@@ -148,7 +148,7 @@ public class MockBundleResource implemen
     }
 
     /**
-     * @see org.apache.sling.installer.api.tasks.TaskResource#setState(org.apache.sling.installer.api.tasks.ResourceState)
+     * Set the state
      */
     public void setState(ResourceState s) {
         this.state = s;

Modified: sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreatorTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreatorTest.java?rev=1060001&r1=1060000&r2=1060001&view=diff
==============================================================================
--- sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreatorTest.java
(original)
+++ sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/tasks/BundleTaskCreatorTest.java
Mon Jan 17 17:16:50 2011
@@ -155,7 +155,7 @@ public class BundleTaskCreatorTest {
     @Test
     public void testBundleRemoveSingle() throws IOException {
         final String version = "1.0";
-        final TaskResource [] r = {
+        final MockBundleResource [] r = {
                 new MockBundleResource(SN, version)
         };
         r[0].setState(ResourceState.UNINSTALL);
@@ -171,12 +171,12 @@ public class BundleTaskCreatorTest {
 
     @Test
     public void testBundleRemoveMultiple() throws IOException {
-        final TaskResource [] r = {
+        final MockBundleResource [] r = {
                 new MockBundleResource(SN, "1.0"),
                 new MockBundleResource(SN, "1.1"),
                 new MockBundleResource(SN, "2.0")
         };
-        for(TaskResource x : r) {
+        for(MockBundleResource x : r) {
             x.setState(ResourceState.UNINSTALL);
         }
 
@@ -195,7 +195,7 @@ public class BundleTaskCreatorTest {
 
     @Test
     public void testDowngradeOfRemovedResource() throws IOException {
-        final TaskResource [] r = {
+        final MockBundleResource [] r = {
                 new MockBundleResource(SN, "1.0.0"),
                 new MockBundleResource(SN, "1.1.0"),
         };



Mime
View raw message