incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1058233 - in /sling/trunk/installer/core/src: 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/ main/java/org/apache/sling/installer/core/...
Date Wed, 12 Jan 2011 17:01:01 GMT
Author: cziegeler
Date: Wed Jan 12 17:00:57 2011
New Revision: 1058233

URL: http://svn.apache.org/viewvc?rev=1058233&view=rev
Log:
SLING-1922 : Allow resource transformer for processing installable resources

Added:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResourceGroup.java   (contents, props changed)
      - copied, changed from r1058196, sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResourceGroup.java
Removed:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResourceGroup.java
Modified:
    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/RegisteredResource.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/DefaultTransformer.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/config/ConfigInstallTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigRemoveTask.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigTaskCreator.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/BundleTaskCreator.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/ChangeStateTask.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/RegisteredResourceTest.java

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -28,11 +28,11 @@ import org.slf4j.LoggerFactory;
  */
 public abstract class InstallTask implements Comparable<InstallTask> {
 
-    private final RegisteredResourceGroup resourceGroup;
+    private final TaskResourceGroup resourceGroup;
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
-    public InstallTask(final RegisteredResourceGroup erl) {
+    public InstallTask(final TaskResourceGroup erl) {
         this.resourceGroup = erl;
     }
 
@@ -49,7 +49,7 @@ public abstract class InstallTask implem
     /**
      * Return the corresponding resource - depending on the task this might be null.
      */
-    public RegisteredResourceGroup getResourceGroup() {
+    public TaskResourceGroup getResourceGroup() {
         return this.resourceGroup;
     }
 

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -24,5 +24,5 @@ public interface InstallTaskFactory {
      * Creates an {@link InstallTask} for the resource or
      * <code>null</code> if the factory does not support the resource.
      */
-    InstallTask createTask(final RegisteredResourceGroup toActivate);
+    InstallTask createTask(final TaskResourceGroup toActivate);
 }

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -22,22 +22,21 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Dictionary;
 
-import org.apache.sling.installer.api.OsgiInstaller;
-
-/** A resource that's been registered in the OSGi controller.
- * 	Data can be either an InputStream or a Dictionary, and we store
- *  it locally to avoid holding up to classes or data from our
- *  clients, in case those disappear while we're installing stuff.
+/**
+ * A resource that's been registered in the OSGi controller.
+ * Data can be either an input stream or a dictionary.
  */
 public interface RegisteredResource {
 
-    /** Return the scheme from where the artifact is orginated. */
+    /**
+     * Return the scheme from where the artifact is orginated.
+     */
     String getScheme();
 
     /**
-     * Return this data's url. It is opaque for the {@link OsgiInstaller}
-     * but should uniquely identify the resource within the namespace of
-     * the used installation mechanism.
+     * Return this data's url. The url is the {@link #getScheme}
+     * followed by a colon, followed by a unique identifier of
+     * the resource within the providers space..
      */
     String getURL();
 
@@ -79,9 +78,10 @@ public interface RegisteredResource {
      */
     int getPriority();
 
-	/** Return the identifier of the OSGi "entity" that this resource
-     *  represents, for example "bundle:SID" where SID is the bundle's
-     *  symbolic ID, or "config:PID" where PID is config's PID.
+	/**
+	 * Return the identifier of the OSGi "entity" that this resource
+     * represents, for example "bundle:SID" where SID is the bundle's
+     * symbolic ID, or "config:PID" where PID is config's PID.
      */
     String getEntityId();
 }

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -18,19 +18,28 @@
  */
 package org.apache.sling.installer.api.tasks;
 
-import java.util.Map;
 
-/** A resource that's been registered in the OSGi controller.
- * 	Data can be either an InputStream or a Dictionary, and we store
- *  it locally to avoid holding up to classes or data from our
- *  clients, in case those disappear while we're installing stuff.
+/**
+ * A task resource is a registered resource which has been
+ * processed by a {@link ResourceTransformer} and is now
+ * about to be processed by an {@InstallTask}.
  */
 public interface TaskResource extends RegisteredResource {
 
-	/**
-	 * Attributes include the bundle symbolic name, bundle version, etc.
-	 */
-	Map<String, Object> getAttributes();
+    /**
+     * Get the value of an attribute.
+     * Attributes include the bundle symbolic name, bundle version, etc.
+     * @param key The name of the attribute
+     * @return The value of the attribute or <code>null</code>
+     */
+    Object getAttribute(String key);
+
+    /**
+     * Set the value of an attribute.
+     * @param key The name of the attribute
+     * @param value The attribute value or <code>null</code> to remove it.
+     */
+    void setAttribute(String key, Object value);
 
     /**
      * Get the current state of the resource.
@@ -54,5 +63,5 @@ public interface TaskResource extends Re
      * @param key The name of the attribute
      * @param value The attribute value or <code>null</code> to remove it.
      */
-    void setTemporaryAttributee(String key, Object value);
+    void setTemporaryAttribute(String key, Object value);
 }

Copied: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResourceGroup.java (from r1058196, sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResourceGroup.java)
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResourceGroup.java?p2=sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResourceGroup.java&p1=sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResourceGroup.java&r1=1058196&r2=1058233&rev=1058233&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/RegisteredResourceGroup.java (original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/api/tasks/TaskResourceGroup.java Wed Jan 12 17:00:57 2011
@@ -23,7 +23,7 @@ package org.apache.sling.installer.api.t
  * This is a group of resources all pointing to the same artifact,
  * but maybe in different versions or locations.
  */
-public interface RegisteredResourceGroup {
+public interface TaskResourceGroup {
 
 
     /**

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

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

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

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java?rev=1058233&r1=1058232&r2=1058233&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java (original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/DefaultTransformer.java Wed Jan 12 17:00:57 2011
@@ -29,7 +29,6 @@ import org.apache.sling.installer.api.In
 import org.apache.sling.installer.api.tasks.RegisteredResource;
 import org.apache.sling.installer.api.tasks.ResourceTransformer;
 import org.apache.sling.installer.api.tasks.TransformationResult;
-import org.apache.sling.installer.core.impl.config.ConfigTaskCreator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.service.cm.ConfigurationAdmin;
@@ -142,13 +141,9 @@ public class DefaultTransformer
         final Map<String, Object> attr = new HashMap<String, Object>();
 
         attr.put(Constants.SERVICE_PID, configPid);
-        // Add pseudo-properties
-        resource.getDictionary().put(ConfigTaskCreator.CONFIG_PATH_KEY, resource.getURL());
-
         // Factory?
         if (factoryPid != null) {
             attr.put(ConfigurationAdmin.SERVICE_FACTORYPID, factoryPid);
-            resource.getDictionary().put(ConfigTaskCreator.ALIAS_KEY, configPid);
         }
 
         final TransformationResult tr = new TransformationResult();

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -28,7 +28,7 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 
 import org.apache.sling.installer.api.tasks.RegisteredResource;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
+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.slf4j.Logger;
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
  * Persistent list of RegisteredResource, used by installer to
  * keep track of all registered resources
  */
-public class EntityResourceList implements Serializable, RegisteredResourceGroup {
+public class EntityResourceList implements Serializable, TaskResourceGroup {
 
     /** Use own serial version ID as we control serialization. */
     private static final long serialVersionUID = 6L;

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -38,7 +38,7 @@ 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.RegisteredResourceGroup;
+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;
@@ -473,7 +473,7 @@ public class OsgiInstallerImpl
      * Get the task for the resource.
      */
     private InstallTask getTask(final Object[] services,
-            final RegisteredResourceGroup rrg) {
+            final TaskResourceGroup rrg) {
         InstallTask result = null;
 
         for(int i=0; i<services.length; i++) {

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -237,11 +237,22 @@ public class RegisteredResourceImpl
     }
 
     /**
-     * @see org.apache.sling.installer.api.tasks.TaskResource#getAttributes()
+     * @see org.apache.sling.installer.api.tasks.TaskResource#getAttribute(java.lang.String)
      */
-    public Map<String, Object> getAttributes() {
-		return attributes;
-	}
+    public Object getAttribute(final String key) {
+        return this.attributes.get(key);
+    }
+
+    /**
+     * @see org.apache.sling.installer.api.tasks.TaskResource#setAttribute(java.lang.String, java.lang.Object)
+     */
+    public void setAttribute(final String key, final Object value) {
+        if ( value == null ) {
+            this.attributes.remove(key);
+        } else {
+            this.attributes.put(key, value);
+        }
+    }
 
     /**
      * @see org.apache.sling.installer.api.tasks.RegisteredResource#getScheme()
@@ -342,8 +353,8 @@ public class RegisteredResourceImpl
         int result = 0;
 
         // Order by version
-        final Version va = new Version((String)a.getAttributes().get(Constants.BUNDLE_VERSION));
-        final Version vb = new Version((String)b.getAttributes().get(Constants.BUNDLE_VERSION));
+        final Version va = new Version((String)a.getAttribute(Constants.BUNDLE_VERSION));
+        final Version vb = new Version((String)b.getAttribute(Constants.BUNDLE_VERSION));
         isSnapshot = va.toString().contains("SNAPSHOT");
         // higher version has more priority, must come first so invert comparison
         result = vb.compareTo(va);
@@ -371,9 +382,9 @@ public class RegisteredResourceImpl
     }
 
     /**
-     * @see org.apache.sling.installer.api.tasks.TaskResource#setTemporaryAttributee(java.lang.String, java.lang.Object)
+     * @see org.apache.sling.installer.api.tasks.TaskResource#setTemporaryAttribute(java.lang.String, java.lang.Object)
      */
-    public void setTemporaryAttributee(final String key, final Object value) {
+    public void setTemporaryAttribute(final String key, final Object value) {
         if ( this.temporaryAttributes == null ) {
             this.temporaryAttributes = new HashMap<String, Object>();
         }

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -22,17 +22,20 @@ import java.io.IOException;
 import java.util.Dictionary;
 import java.util.Enumeration;
 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.RegisteredResourceGroup;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.osgi.framework.Constants;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.util.tracker.ServiceTracker;
 
-/** Base class for configuration-related tasks */
+/**
+ * Base class for configuration-related tasks
+ */
 abstract class AbstractConfigTask extends InstallTask {
 
     /** Configuration properties to ignore when comparing configs */
@@ -40,19 +43,23 @@ abstract class AbstractConfigTask extend
     static {
         ignoredProperties.add("service.pid");
         ignoredProperties.add(ConfigTaskCreator.CONFIG_PATH_KEY);
+        ignoredProperties.add(ConfigTaskCreator.ALIAS_KEY);
     }
 
+    /** Configuration PID */
     protected final String configPid;
+
+    /** Factory PID or null */
     protected final String factoryPid;
 
     /** Tracker for the configuration admin. */
     private final ServiceTracker configAdminServiceTracker;
 
-    AbstractConfigTask(final RegisteredResourceGroup r, final ServiceTracker configAdminServiceTracker) {
+    AbstractConfigTask(final TaskResourceGroup r, final ServiceTracker configAdminServiceTracker) {
         super(r);
         this.configAdminServiceTracker = configAdminServiceTracker;
-        this.configPid = (String)getResource().getAttributes().get(Constants.SERVICE_PID);
-        this.factoryPid = (String)getResource().getAttributes().get(ConfigurationAdmin.SERVICE_FACTORYPID);
+        this.configPid = (String)getResource().getAttribute(Constants.SERVICE_PID);
+        this.factoryPid = (String)getResource().getAttribute(ConfigurationAdmin.SERVICE_FACTORYPID);
     }
 
     /**
@@ -66,6 +73,26 @@ abstract class AbstractConfigTask extend
         return (factoryPid == null ? "" : factoryPid + ".") + configPid;
     }
 
+    protected Dictionary<String, Object> getDictionary() {
+        // Copy dictionary and add pseudo-properties
+        final Dictionary<String, Object> d = this.getResource().getDictionary();
+        if ( d == null ) {
+            return null;
+        }
+
+        final Dictionary<String, Object> result = new Hashtable<String, Object>();
+        final Enumeration<String> e = d.keys();
+        while(e.hasMoreElements()) {
+            final String key = e.nextElement();
+            result.put(key, d.get(key));
+        }
+
+        result.put(ConfigTaskCreator.CONFIG_PATH_KEY, getResource().getURL());
+        result.put(ConfigTaskCreator.ALIAS_KEY, configPid);
+
+        return result;
+    }
+
     protected Configuration getConfiguration(final ConfigurationAdmin ca,
                                              final boolean createIfNeeded)
     throws IOException, InvalidSyntaxException {

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigInstallTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigInstallTask.java?rev=1058233&r1=1058232&r2=1058233&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigInstallTask.java (original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigInstallTask.java Wed Jan 12 17:00:57 2011
@@ -19,8 +19,8 @@
 package org.apache.sling.installer.core.impl.config;
 
 import org.apache.sling.installer.api.tasks.InstallationContext;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
 import org.apache.sling.installer.api.tasks.ResourceState;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.util.tracker.ServiceTracker;
@@ -32,7 +32,7 @@ public class ConfigInstallTask extends A
 
     private static final String CONFIG_INSTALL_ORDER = "20-";
 
-    public ConfigInstallTask(final RegisteredResourceGroup r, final ServiceTracker configAdminServiceTracker) {
+    public ConfigInstallTask(final TaskResourceGroup r, final ServiceTracker configAdminServiceTracker) {
         super(r, configAdminServiceTracker);
     }
 
@@ -70,7 +70,7 @@ public class ConfigInstallTask extends A
                 if (config.getBundleLocation() != null) {
                     config.setBundleLocation(null);
                 }
-                config.update(getResource().getDictionary());
+                config.update(getDictionary());
                 ctx.log("Installed configuration {} from resource {}", config.getPid(), getResource());
                 this.setFinishedState(ResourceState.INSTALLED);
                 this.getLogger().debug("Configuration " + config.getPid()

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigRemoveTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigRemoveTask.java?rev=1058233&r1=1058232&r2=1058233&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigRemoveTask.java (original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigRemoveTask.java Wed Jan 12 17:00:57 2011
@@ -19,7 +19,7 @@
 package org.apache.sling.installer.core.impl.config;
 
 import org.apache.sling.installer.api.tasks.InstallationContext;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.apache.sling.installer.api.tasks.ResourceState;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
@@ -30,7 +30,7 @@ public class ConfigRemoveTask extends Ab
 
     private static final String CONFIG_REMOVE_ORDER = "10-";
 
-    public ConfigRemoveTask(final RegisteredResourceGroup r,
+    public ConfigRemoveTask(final TaskResourceGroup r,
             final ServiceTracker configAdminServiceTracker) {
         super(r, configAdminServiceTracker);
     }

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigTaskCreator.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigTaskCreator.java?rev=1058233&r1=1058232&r2=1058233&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigTaskCreator.java (original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/config/ConfigTaskCreator.java Wed Jan 12 17:00:57 2011
@@ -21,9 +21,9 @@ package org.apache.sling.installer.core.
 import org.apache.sling.installer.api.InstallableResource;
 import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.InstallTaskFactory;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
 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.InternalService;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.ConfigurationAdmin;
@@ -72,9 +72,9 @@ public class ConfigTaskCreator implement
     /**
      * Create a task to install or uninstall a configuration.
      *
-	 * @see org.apache.sling.installer.api.tasks.InstallTaskFactory#createTask(org.apache.sling.installer.api.tasks.RegisteredResourceGroup)
+	 * @see org.apache.sling.installer.api.tasks.InstallTaskFactory#createTask(org.apache.sling.installer.api.tasks.TaskResourceGroup)
 	 */
-	public InstallTask createTask(final RegisteredResourceGroup group) {
+	public InstallTask createTask(final TaskResourceGroup group) {
         final TaskResource toActivate = group.getActiveResource();
         if ( !toActivate.getType().equals(InstallableResource.TYPE_CONFIG) ) {
             return null;

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -19,9 +19,9 @@
 package org.apache.sling.installer.core.impl.tasks;
 
 import org.apache.sling.installer.api.InstallableResource;
-import org.apache.sling.installer.api.tasks.InstallationContext;
 import org.apache.sling.installer.api.tasks.InstallTask;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
+import org.apache.sling.installer.api.tasks.InstallationContext;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.osgi.framework.Bundle;
 import org.osgi.service.startlevel.StartLevel;
 
@@ -33,7 +33,7 @@ public class BundleInstallTask extends I
 
     private final BundleTaskCreator creator;
 
-    public BundleInstallTask(final RegisteredResourceGroup r,
+    public BundleInstallTask(final TaskResourceGroup r,
             final BundleTaskCreator creator) {
         super(r);
         this.creator = creator;
@@ -69,7 +69,7 @@ public class BundleInstallTask extends I
             }
 
             // mark this resource as installed and to be started
-            this.getResource().getAttributes().put(BundleTaskCreator.ATTR_START, "true");
+            this.getResource().setAttribute(BundleTaskCreator.ATTR_START, "true");
             ctx.addTaskToCurrentCycle(new BundleStartTask(getResourceGroup(), b.getBundleId(), this.creator));
         } catch (Exception ex) {
             // if something goes wrong we simply try it again

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -20,8 +20,8 @@ package org.apache.sling.installer.core.
 
 import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.InstallationContext;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
 import org.apache.sling.installer.api.tasks.ResourceState;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
@@ -36,7 +36,7 @@ public class BundleRemoveTask extends In
 
     private final BundleTaskCreator creator;
 
-    public BundleRemoveTask(final RegisteredResourceGroup r,
+    public BundleRemoveTask(final TaskResourceGroup r,
                             final BundleTaskCreator creator) {
         super(r);
         this.creator = creator;
@@ -46,7 +46,7 @@ public class BundleRemoveTask extends In
      * @see org.apache.sling.installer.api.tasks.InstallTask#execute(org.apache.sling.installer.api.tasks.InstallationContext)
      */
     public void execute(InstallationContext ctx) {
-        final String symbolicName = (String)getResource().getAttributes().get(Constants.BUNDLE_SYMBOLICNAME);
+        final String symbolicName = (String)getResource().getAttribute(Constants.BUNDLE_SYMBOLICNAME);
         final Bundle b = this.creator.getMatchingBundle(symbolicName);
         if (b == null) {
             // nothing to do, so just stop

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -22,9 +22,9 @@ 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.RegisteredResourceGroup;
 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.OsgiInstallerImpl;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
@@ -48,7 +48,7 @@ public class BundleStartTask extends Ins
 
 	private final BundleTaskCreator creator;
 
-	public BundleStartTask(final RegisteredResourceGroup r, final long bundleId, final BundleTaskCreator btc) {
+	public BundleStartTask(final TaskResourceGroup r, final long bundleId, final BundleTaskCreator btc) {
 	    super(r);
         this.bundleId = bundleId;
         this.creator = btc;
@@ -131,8 +131,8 @@ public class BundleStartTask extends Ins
             if ( this.getResource() == null ) {
                 ctx.addTaskToNextCycle(this);
             } else {
-                this.getResource().setTemporaryAttributee(ATTR_RC, this.retryCount);
-                this.getResource().setTemporaryAttributee(ATTR_EC, this.eventsCountForRetrying);
+                this.getResource().setTemporaryAttribute(ATTR_RC, this.retryCount);
+                this.getResource().setTemporaryAttribute(ATTR_EC, this.eventsCountForRetrying);
             }
         }
 	}

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -21,9 +21,9 @@ package org.apache.sling.installer.core.
 import org.apache.sling.installer.api.InstallableResource;
 import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.InstallTaskFactory;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
 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.InternalService;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -133,23 +133,23 @@ public class BundleTaskCreator implement
 	/**
      * Create a bundle task - install, update or remove
      *
-	 * @see org.apache.sling.installer.api.tasks.InstallTaskFactory#createTask(org.apache.sling.installer.api.tasks.RegisteredResourceGroup)
+	 * @see org.apache.sling.installer.api.tasks.InstallTaskFactory#createTask(org.apache.sling.installer.api.tasks.TaskResourceGroup)
 	 */
-	public InstallTask createTask(final RegisteredResourceGroup resourceList) {
+	public InstallTask createTask(final TaskResourceGroup resourceList) {
 	    final TaskResource toActivate = resourceList.getActiveResource();
 	    if ( !toActivate.getType().equals(InstallableResource.TYPE_BUNDLE) ) {
 	        return null;
 	    }
 	    final InstallTask result;
 
-        final String symbolicName = (String)toActivate.getAttributes().get(Constants.BUNDLE_SYMBOLICNAME);
+        final String symbolicName = (String)toActivate.getAttribute(Constants.BUNDLE_SYMBOLICNAME);
         final BundleInfo info = this.getBundleInfo(symbolicName);
 
 		// Uninstall
 		if (toActivate.getState() == ResourceState.UNINSTALL) {
 		    // Remove corresponding bundle if present and if we installed it
 		    if (info != null
-		        && info.version.equals(new Version((String)toActivate.getAttributes().get(Constants.BUNDLE_VERSION))) ) {
+		        && info.version.equals(new Version((String)toActivate.getAttribute(Constants.BUNDLE_VERSION))) ) {
 		        result = new BundleRemoveTask(resourceList, this);
 		    } else {
 	            logger.info("Bundle {} was not installed by this module, not removed", symbolicName);
@@ -162,12 +162,12 @@ public class BundleTaskCreator implement
 		    if (info == null) {
 			    // bundle is not installed yet: install
 			    result = new BundleInstallTask(resourceList, this);
-		    } else if ( toActivate.getAttributes().get(ATTR_START) != null ) {
+		    } else if ( toActivate.getAttribute(ATTR_START) != null ) {
 	            result = new BundleStartTask(resourceList, info.id, this);
 			} else {
 	            boolean doUpdate = false;
 
-	            final Version newVersion = new Version((String)toActivate.getAttributes().get(Constants.BUNDLE_VERSION));
+	            final Version newVersion = new Version((String)toActivate.getAttribute(Constants.BUNDLE_VERSION));
 			    final int compare = info.version.compareTo(newVersion);
                 if (compare < 0) {
                     // installed version is lower -> update

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -20,8 +20,8 @@ package org.apache.sling.installer.core.
 
 import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.InstallationContext;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
 import org.apache.sling.installer.api.tasks.ResourceState;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
@@ -38,7 +38,7 @@ public class BundleUpdateTask extends In
 
     private final BundleTaskCreator creator;
 
-    public BundleUpdateTask(final RegisteredResourceGroup r,
+    public BundleUpdateTask(final TaskResourceGroup r,
                             final BundleTaskCreator creator) {
         super(r);
         this.creator = creator;
@@ -48,7 +48,7 @@ public class BundleUpdateTask extends In
      * @see org.apache.sling.installer.api.tasks.InstallTask#execute(org.apache.sling.installer.api.tasks.InstallationContext)
      */
     public void execute(InstallationContext ctx) {
-        final String symbolicName = (String)getResource().getAttributes().get(Constants.BUNDLE_SYMBOLICNAME);
+        final String symbolicName = (String)getResource().getAttribute(Constants.BUNDLE_SYMBOLICNAME);
         final Bundle b = this.creator.getMatchingBundle(symbolicName);
         if (b == null) {
             this.getLogger().debug("Bundle to update ({}) not found", symbolicName);
@@ -56,7 +56,7 @@ public class BundleUpdateTask extends In
             return;
         }
 
-        final Version newVersion = new Version((String)getResource().getAttributes().get(Constants.BUNDLE_VERSION));
+        final Version newVersion = new Version((String)getResource().getAttribute(Constants.BUNDLE_VERSION));
 
         // Do not update if same version, unless snapshot
         boolean snapshot = false;
@@ -79,7 +79,7 @@ public class BundleUpdateTask extends In
             ctx.log("Updated bundle {} from resource {}", b, getResource());
 
             if (reactivate) {
-                this.getResource().getAttributes().put(BundleTaskCreator.ATTR_START, "true");
+                this.getResource().setAttribute(BundleTaskCreator.ATTR_START, "true");
                 ctx.addTaskToCurrentCycle(new BundleStartTask(this.getResourceGroup(), b.getBundleId(), this.creator));
             } else {
                 this.setFinishedState(ResourceState.INSTALLED);

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/ChangeStateTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/ChangeStateTask.java?rev=1058233&r1=1058232&r2=1058233&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/ChangeStateTask.java (original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/tasks/ChangeStateTask.java Wed Jan 12 17:00:57 2011
@@ -20,7 +20,7 @@ package org.apache.sling.installer.core.
 
 import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.InstallationContext;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.apache.sling.installer.api.tasks.ResourceState;
 
 /**
@@ -32,7 +32,7 @@ public class ChangeStateTask extends Ins
 
     private final ResourceState state;
 
-    public ChangeStateTask(final RegisteredResourceGroup r,
+    public ChangeStateTask(final TaskResourceGroup r,
                            final ResourceState s) {
         super(r);
         this.state = s;

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 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.InstallationContext;
 import org.apache.sling.installer.api.tasks.InstallTask;
-import org.apache.sling.installer.api.tasks.RegisteredResourceGroup;
+import org.apache.sling.installer.api.tasks.InstallationContext;
+import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
@@ -37,7 +37,7 @@ public class SystemBundleUpdateTask exte
 
     private final BundleTaskCreator creator;
 
-    public SystemBundleUpdateTask(final RegisteredResourceGroup r,
+    public SystemBundleUpdateTask(final TaskResourceGroup r,
             final BundleTaskCreator creator) {
         super(r);
         this.creator = creator;
@@ -45,7 +45,7 @@ public class SystemBundleUpdateTask exte
 
     @Override
     public void execute(InstallationContext ctx) {
-        final String symbolicName = (String)getResource().getAttributes().get(Constants.BUNDLE_SYMBOLICNAME);
+        final String symbolicName = (String)getResource().getAttribute(Constants.BUNDLE_SYMBOLICNAME);
         final Bundle b = this.creator.getMatchingBundle(symbolicName);
         if (b == null) {
             throw new IllegalStateException("Bundle to update (" + symbolicName + ") not found");

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=1058233&r1=1058232&r2=1058233&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 Wed Jan 12 17:00:57 2011
@@ -78,13 +78,6 @@ public class MockBundleResource implemen
 	}
 
 	/**
-	 * @see org.apache.sling.installer.api.tasks.TaskResource#getAttributes()
-	 */
-	public Map<String, Object> getAttributes() {
-		return attributes;
-	}
-
-	/**
 	 * @see org.apache.sling.installer.api.tasks.RegisteredResource#getDictionary()
 	 */
 	public Dictionary<String, Object> getDictionary() {
@@ -162,6 +155,24 @@ public class MockBundleResource implemen
     }
 
     /**
+     * @see org.apache.sling.installer.api.tasks.TaskResource#getAttribute(java.lang.String)
+     */
+    public Object getAttribute(String key) {
+        return this.attributes.get(key);
+    }
+
+    /**
+     * @see org.apache.sling.installer.api.tasks.TaskResource#setAttribute(java.lang.String, java.lang.Object)
+     */
+    public void setAttribute(String key, Object value) {
+        if ( value == null ) {
+            this.attributes.remove(key);
+        } else {
+            this.attributes.put(key, value);
+        }
+    }
+
+    /**
      * @see org.apache.sling.installer.api.tasks.TaskResource#getTemporaryAttribute(java.lang.String)
      */
     public Object getTemporaryAttribute(String key) {
@@ -169,9 +180,9 @@ public class MockBundleResource implemen
     }
 
     /**
-     * @see org.apache.sling.installer.api.tasks.TaskResource#setTemporaryAttributee(java.lang.String, java.lang.Object)
+     * @see org.apache.sling.installer.api.tasks.TaskResource#setTemporaryAttribute(java.lang.String, java.lang.Object)
      */
-    public void setTemporaryAttributee(String key, Object value) {
+    public void setTemporaryAttribute(String key, Object value) {
         if ( value == null ) {
             this.tempAttributes.remove(key);
         } else {

Modified: sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/RegisteredResourceTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/RegisteredResourceTest.java?rev=1058233&r1=1058232&r2=1058233&view=diff
==============================================================================
--- sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/RegisteredResourceTest.java (original)
+++ sling/trunk/installer/core/src/test/java/org/apache/sling/installer/core/impl/RegisteredResourceTest.java Wed Jan 12 17:00:57 2011
@@ -74,8 +74,8 @@ public class RegisteredResourceTest {
             assertNull("CONFIG resource does not provide an InputStream", rs);
             final Dictionary<String, Object> d = r.getDictionary();
             assertNotNull("CONFIG resource provides a Dictionary", d);
-            assertEquals("CONFIG resource dictionary has three properties", 3, d.size());
-            assertNotNull("CONFIG resource has a pid attribute", r.getAttributes().get(Constants.SERVICE_PID));
+            assertEquals("CONFIG resource dictionary has two properties", 2, d.size());
+            assertNotNull("CONFIG resource has a pid attribute", r.getAttribute(Constants.SERVICE_PID));
         }
     }
 
@@ -114,14 +114,14 @@ public class RegisteredResourceTest {
         final File f = getTestBundle("testbundle-1.0.jar");
         final InstallableResource i = new InstallableResource("test:" + f.getAbsolutePath(), new FileInputStream(f), null, f.getName(), null, null);
         final TaskResource r = create(i);
-        assertNotNull("RegisteredResource must have bundle symbolic name", r.getAttributes().get(Constants.BUNDLE_SYMBOLICNAME));
+        assertNotNull("RegisteredResource must have bundle symbolic name", r.getAttribute(Constants.BUNDLE_SYMBOLICNAME));
         assertEquals("RegisteredResource entity ID must match", "bundle:osgi-installer-testbundle", r.getEntityId());
     }
 
     @org.junit.Test public void testConfigEntity() throws Exception {
         final InstallableResource i = new InstallableResource("test:/foo/someconfig", null, new Hashtable<String, Object>(), null, null, null);
         final TaskResource r = create(i);
-        assertNull("RegisteredResource must not have bundle symbolic name", r.getAttributes().get(Constants.BUNDLE_SYMBOLICNAME));
+        assertNull("RegisteredResource must not have bundle symbolic name", r.getAttribute(Constants.BUNDLE_SYMBOLICNAME));
         assertEquals("RegisteredResource entity ID must match", "config:someconfig", r.getEntityId());
     }
 



Mime
View raw message