incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r984106 [1/2] - in /sling/trunk/installer: jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/ jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/ osgi/installer/src/main/java/org/apache/sling/osgi/installer/ o...
Date Tue, 10 Aug 2010 16:17:20 GMT
Author: cziegeler
Date: Tue Aug 10 16:17:19 2010
New Revision: 984106

URL: http://svn.apache.org/viewvc?rev=984106&view=rev
Log:
SLING-1560 : Improve and clean up code
Slightly change installer interface and separate between scheme and resource identifier for more api consistency
Fixed one IT test case

Added:
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigTaskCreator.java   (contents, props changed)
      - copied, changed from r983998, sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigTaskCreator.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigurationPid.java   (contents, props changed)
      - copied, changed from r983995, sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigurationPid.java
Removed:
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigTaskCreator.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigurationPid.java
Modified:
    sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/ConfigNodeConverter.java
    sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/FileNodeConverter.java
    sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/JcrInstaller.java
    sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/WatchedFolder.java
    sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockInstallableResource.java
    sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/InstallableResource.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/OsgiInstaller.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/InstallableResourceImpl.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerImpl.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparator.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/AbstractConfigTask.java
    sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/LocalFileRegisteredResource.java
    sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparatorTest.java
    sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceTest.java
    sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/TaskOrderingTest.java
    sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/tasks/ConfigurationPidTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleDependenciesTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallStressTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallUpgradeDowngradeTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundlePrioritiesTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleSnapshotUpdateTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStartRetriesTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStatePreservedTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigInstallTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigPrioritiesTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ContextBundleUpdateTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/InvalidBundlesTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/MockInstallableResource.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/OsgiInstallerTestBase.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RemovedResourceDetectionTest.java
    sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/WorkerThreadIdleTest.java

Modified: sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/ConfigNodeConverter.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/ConfigNodeConverter.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/ConfigNodeConverter.java (original)
+++ sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/ConfigNodeConverter.java Tue Aug 10 16:17:19 2010
@@ -43,8 +43,7 @@ class ConfigNodeConverter implements Jcr
 	/** Convert n to an InstallableData, or return null
 	 * 	if we don't know how to convert it.
 	 */
-	public InstallableResource convertNode(final String urlScheme,
-	        final Node n,
+	public InstallableResource convertNode(final Node n,
 	        final int priority,
 	        final InstallableResourceFactory factory)
 	throws Exception {
@@ -52,7 +51,7 @@ class ConfigNodeConverter implements Jcr
 
 		// We only consider CONFIG_NODE_TYPE nodes
 		if(n.isNodeType(CONFIG_NODE_TYPE)) {
-			result = factory.create(urlScheme + ":" + n.getPath(), null, load(n), null, null, priority);
+			result = factory.create(n.getPath(), null, load(n), null, null, priority);
 			log.debug("Converted node {} to {}", n.getPath(), result);
 		} else {
 			log.debug("Node is not a {} node, ignored:{}", CONFIG_NODE_TYPE, n.getPath());

Modified: sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/FileNodeConverter.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/FileNodeConverter.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/FileNodeConverter.java (original)
+++ sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/FileNodeConverter.java Tue Aug 10 16:17:19 2010
@@ -42,9 +42,9 @@ import org.slf4j.LoggerFactory;
     private final Logger log = LoggerFactory.getLogger(getClass());
 
 	/**
-	 * @see org.apache.sling.jcr.jcrinstall.impl.JcrInstaller.NodeConverter#convertNode(java.lang.String, javax.jcr.Node, int, org.apache.sling.osgi.installer.InstallableResourceFactory)
+	 * @see org.apache.sling.jcr.jcrinstall.impl.JcrInstaller.NodeConverter#convertNode(javax.jcr.Node, int, org.apache.sling.osgi.installer.InstallableResourceFactory)
 	 */
-	public InstallableResource convertNode(final String urlScheme,
+	public InstallableResource convertNode(
 	        final Node n,
 	        final int priority,
 	        final InstallableResourceFactory factory)
@@ -53,7 +53,7 @@ import org.slf4j.LoggerFactory;
 		if(n.hasProperty(JCR_CONTENT_DATA) && n.hasProperty(JCR_CONTENT_LAST_MODIFIED)) {
 			if(acceptNodeName(n.getName())) {
 				try {
-					result = convert(urlScheme, n, n.getPath(), priority, factory);
+					result = convert(n, n.getPath(), priority, factory);
 				} catch(IOException ioe) {
 					log.info("Conversion failed, node {} ignored ({})", n.getPath(), ioe);
 				}
@@ -67,7 +67,7 @@ import org.slf4j.LoggerFactory;
 		return null;
 	}
 
-	private InstallableResource convert(final String urlScheme,
+	private InstallableResource convert(
 	        final Node n,
 	        final String path,
 	        final int priority,
@@ -87,7 +87,7 @@ import org.slf4j.LoggerFactory;
         	throw new IOException("Missing " + JCR_CONTENT_DATA + " property");
         }
 
-        return factory.create(urlScheme + ":" + path, is, null, digest, null, priority);
+        return factory.create(path, is, null, digest, null, priority);
 	}
 
 	boolean acceptNodeName(String name) {

Modified: sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/JcrInstaller.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/JcrInstaller.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/JcrInstaller.java (original)
+++ sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/JcrInstaller.java Tue Aug 10 16:17:19 2010
@@ -136,7 +136,7 @@ public class JcrInstaller implements Eve
 
     /** Convert Nodes to InstallableResources */
     static interface NodeConverter {
-    	InstallableResource convertNode(String urlScheme, Node n, int priority, InstallableResourceFactory factory)
+    	InstallableResource convertNode(Node n, int priority, InstallableResourceFactory factory)
     	throws Exception;
     }
 
@@ -239,7 +239,7 @@ public class JcrInstaller implements Eve
     	}
 
     	log.debug("Registering {} resources with OSGi installer: {}", resources.size(), resources);
-    	installer.registerResources(resources, URL_SCHEME);
+    	installer.registerResources(URL_SCHEME, resources);
 
     	if (backgroundThread != null) {
     	    throw new IllegalStateException("Expected backgroundThread to be null in activate()");
@@ -318,7 +318,7 @@ public class JcrInstaller implements Eve
         final String path = n.getPath();
         final int priority = folderNameFilter.getPriority(path);
         if (priority > 0) {
-            result.add(new WatchedFolder(session, path, priority, URL_SCHEME, converters, installableResourceFactory));
+            result.add(new WatchedFolder(session, path, priority, converters, installableResourceFactory));
         }
         final int depth = path.split("/").length;
         if(depth > maxWatchedFolderDepth) {
@@ -378,7 +378,7 @@ public class JcrInstaller implements Eve
                     // Deletions are handled below
                     if(folderNameFilter.getPriority(path) > 0  && session.itemExists(path)) {
                         addWatchedFolder(new WatchedFolder(session, path,
-                                folderNameFilter.getPriority(path), URL_SCHEME, converters, installableResourceFactory));
+                                folderNameFilter.getPriority(path), converters, installableResourceFactory));
                     }
                 }
             }
@@ -441,11 +441,11 @@ public class JcrInstaller implements Eve
                     final WatchedFolder.ScanResult sr = wf.scan();
                     for(String r : sr.toRemove) {
                         log.info("Removing resource from OSGi installer: {}",r);
-                        installer.removeResource(r);
+                        installer.removeResource(URL_SCHEME, r);
                     }
                     for(InstallableResource r : sr.toAdd) {
                         log.info("Registering resource with OSGi installer: {}",r);
-                        installer.addResource(r);
+                        installer.addResource(URL_SCHEME, r);
                     }
                 }
             }
@@ -458,7 +458,7 @@ public class JcrInstaller implements Eve
                 final List<String> toRemove = updateFoldersList();
                 for(String r : toRemove) {
                     log.info("Removing resource from OSGi installer (folder deleted): {}",r);
-                    installer.removeResource(r);
+                    installer.removeResource(URL_SCHEME, r);
                 }
             }
 

Modified: sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/WatchedFolder.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/WatchedFolder.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/WatchedFolder.java (original)
+++ sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/WatchedFolder.java Tue Aug 10 16:17:19 2010
@@ -50,7 +50,6 @@ class WatchedFolder implements EventList
     private final Session session;
     private static RescanTimer rescanTimer = new RescanTimer();
     private boolean needsScan;
-    private final String urlScheme;
     private final Collection <JcrInstaller.NodeConverter> converters;
     private final Set<String> existingResourceUrls = new HashSet<String>();
     protected final Logger log = LoggerFactory.getLogger(getClass());
@@ -70,7 +69,6 @@ class WatchedFolder implements EventList
     WatchedFolder(final Session session,
             final String path,
             final int priority,
-    		final String urlScheme,
     		final Collection<JcrInstaller.NodeConverter> converters,
     		final InstallableResourceFactory factory)
     throws RepositoryException {
@@ -81,7 +79,6 @@ class WatchedFolder implements EventList
         this.path = path;
         this.converters = converters;
         this.priority = priority;
-        this.urlScheme = urlScheme;
 
         this.session = session;
 
@@ -157,10 +154,10 @@ class WatchedFolder implements EventList
             while(it.hasNext()) {
             	final Node n = it.nextNode();
             	for(JcrInstaller.NodeConverter nc : converters) {
-            		final InstallableResource r = nc.convertNode(urlScheme, n, priority, factory);
+            		final InstallableResource r = nc.convertNode(n, priority, factory);
             		if(r != null) {
-            			resourcesSeen.add(r.getUrl());
-            		    final String oldDigest = digests.get(r.getUrl());
+            			resourcesSeen.add(r.getId());
+            		    final String oldDigest = digests.get(r.getId());
             		    if(r.getDigest().equals(oldDigest)) {
             		    	log.debug("Digest didn't change, ignoring " + r);
             		    } else {
@@ -186,8 +183,8 @@ class WatchedFolder implements EventList
 
         // Update saved digests of the resources that we're returning
         for(InstallableResource r : result.toAdd) {
-            existingResourceUrls.add(r.getUrl());
-            digests.put(r.getUrl(), r.getDigest());
+            existingResourceUrls.add(r.getId());
+            digests.put(r.getId(), r.getDigest());
         }
 
         return result;

Modified: sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockInstallableResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockInstallableResource.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockInstallableResource.java (original)
+++ sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockInstallableResource.java Tue Aug 10 16:17:19 2010
@@ -123,7 +123,7 @@ public class MockInstallableResource imp
         return this.type;
     }
 
-    public String getUrl() {
+    public String getId() {
         return this.uri;
     }
 

Modified: sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java (original)
+++ sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/MockOsgiInstaller.java Tue Aug 10 16:17:19 2010
@@ -37,7 +37,7 @@ class MockOsgiInstaller implements OsgiI
 
     static class InstallableResourceComparator implements Comparator<InstallableResource> {
         public int compare(InstallableResource a, InstallableResource b) {
-            return a.getUrl().compareTo(b.getUrl());
+            return a.getId().compareTo(b.getId());
         }
 
     }
@@ -48,8 +48,11 @@ class MockOsgiInstaller implements OsgiI
     /** Keep track of registered URLS */
     private final Set<String> urls = new HashSet<String>();
 
-    public void addResource(InstallableResource d) {
-    	urls.add(d.getUrl());
+    /**
+     * @see org.apache.sling.osgi.installer.OsgiInstaller#addResource(java.lang.String, org.apache.sling.osgi.installer.InstallableResource)
+     */
+    public void addResource(final String scheme, InstallableResource d) {
+    	urls.add(scheme + ':' + d.getId());
         recordCall("add", d);
     }
 
@@ -57,29 +60,32 @@ class MockOsgiInstaller implements OsgiI
         return counters;
     }
 
-    public void registerResources(Collection<InstallableResource> data, String urlScheme) {
+    /**
+     * @see org.apache.sling.osgi.installer.OsgiInstaller#registerResources(java.lang.String, java.util.Collection)
+     */
+    public void registerResources(String urlScheme, Collection<InstallableResource> data) {
         // Sort the data to allow comparing the recorded calls reliably
         final List<InstallableResource> sorted = new LinkedList<InstallableResource>();
         sorted.addAll(data);
         Collections.sort(sorted, new InstallableResourceComparator());
         for(InstallableResource r : data) {
-        	urls.add(r.getUrl());
+        	urls.add(urlScheme + ':' + r.getId());
             recordCall("register", r);
         }
     }
 
     /**
-     * @see org.apache.sling.osgi.installer.OsgiInstaller#removeResource(java.lang.String)
+     * @see org.apache.sling.osgi.installer.OsgiInstaller#removeResource(java.lang.String, String)
      */
-    public void removeResource(String url) {
-    	urls.remove(url);
+    public void removeResource(String urlScheme, String url) {
+    	urls.remove(urlScheme + ':' + url);
     	synchronized ( this) {
-            recordedCalls.add("remove:" + url + ":100");
+            recordedCalls.add("remove:" + urlScheme + ':' + url + ":100");
     	}
     }
 
     private synchronized void recordCall(String prefix, InstallableResource r) {
-        recordedCalls.add(prefix + ":" + r.getUrl() + ":" + r.getPriority());
+        recordedCalls.add(prefix + ":" + r.getId() + ":" + r.getPriority());
     }
 
     synchronized void clearRecordedCalls() {

Modified: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/InstallableResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/InstallableResource.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/InstallableResource.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/InstallableResource.java Tue Aug 10 16:17:19 2010
@@ -46,7 +46,7 @@ public interface InstallableResource {
 	 * but the scheme must be the one used in the
 	 * {@link OsgiInstaller#registerResources} call.
 	 */
-    String getUrl();
+    String getId();
 
 	/**
 	 * Return the type of this resource.

Modified: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/OsgiInstaller.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/OsgiInstaller.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/OsgiInstaller.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/OsgiInstaller.java Tue Aug 10 16:17:19 2010
@@ -46,15 +46,15 @@ public interface OsgiInstaller {
 	 * 	@param urlScheme identifies the client. All URLs of the supplied data
 	 * 		must use this scheme
 	 */
-	void registerResources(Collection<InstallableResource> data, String urlScheme);
+	void registerResources(String urlScheme, Collection<InstallableResource> data);
 
 	/** Inform the installer that a resource is available for installation.
 	 * 	also called if the resource has been modified since it was registered.
 	 *  Invalid resources are ignored.
 	 */
-	void addResource(InstallableResource r);
+	void addResource(String urlScheme, InstallableResource r);
 
 	/** Inform the installer that a resource is no longer available
 	 * 	@param r an empty InstallableResource, isEmpty() must return true */
-	void removeResource(String url);
+	void removeResource(String urlScheme, String id);
 }
\ No newline at end of file

Modified: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/InstallableResourceImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/InstallableResourceImpl.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/InstallableResourceImpl.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/InstallableResourceImpl.java Tue Aug 10 16:17:19 2010
@@ -30,7 +30,7 @@ import org.apache.sling.osgi.installer.O
  */
 public class InstallableResourceImpl implements InstallableResource {
 
-    private final String url;
+    private final String id;
     private final String digest;
     private final InputStream inputStream;
     private final Dictionary<String, Object> dictionary;
@@ -40,13 +40,13 @@ public class InstallableResourceImpl imp
     /**
      * Create a data object.
      */
-    public InstallableResourceImpl(final String url,
+    public InstallableResourceImpl(final String id,
             final InputStream is,
             final Dictionary<String, Object> dict,
             String digest,
             final String type,
             final int priority) {
-        this.url = url;
+        this.id = id;
         this.digest = digest;
         this.priority = priority;
         this.resourceType = type;
@@ -55,10 +55,10 @@ public class InstallableResourceImpl imp
     }
 
     /**
-     * @see org.apache.sling.osgi.installer.InstallableResource#getUrl()
+     * @see org.apache.sling.osgi.installer.InstallableResource#getId()
      */
-    public String getUrl() {
-        return this.url;
+    public String getId() {
+        return this.id;
     }
 
     /**
@@ -98,6 +98,6 @@ public class InstallableResourceImpl imp
 
     @Override
     public String toString() {
-        return getClass().getSimpleName() + ", priority=" + priority + ", url=" + url;
+        return getClass().getSimpleName() + ", priority=" + priority + ", id=" + id;
     }
 }

Modified: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerImpl.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerImpl.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerImpl.java Tue Aug 10 16:17:19 2010
@@ -155,24 +155,24 @@ public class OsgiInstallerImpl implement
 	}
 
 	/**
-	 * @see org.apache.sling.osgi.installer.OsgiInstaller#addResource(org.apache.sling.osgi.installer.InstallableResource)
+	 * @see org.apache.sling.osgi.installer.OsgiInstaller#addResource(java.lang.String, org.apache.sling.osgi.installer.InstallableResource)
 	 */
-	public void addResource(final InstallableResource r) {
-        installerThread.addNewResource(r);
+	public void addResource(final String scheme, final InstallableResource r) {
+        installerThread.addNewResource(r, scheme);
 	}
 
 	/**
-	 * @see org.apache.sling.osgi.installer.OsgiInstaller#registerResources(java.util.Collection, java.lang.String)
+	 * @see org.apache.sling.osgi.installer.OsgiInstaller#registerResources(java.lang.String, java.util.Collection)
 	 */
-	public void registerResources(final Collection<InstallableResource> data, String urlScheme) {
+	public void registerResources(final String urlScheme, final Collection<InstallableResource> data) {
         installerThread.addNewResources(data, urlScheme, bundleContext);
 	}
 
 	/**
-	 * @see org.apache.sling.osgi.installer.OsgiInstaller#removeResource(java.lang.String)
+	 * @see org.apache.sling.osgi.installer.OsgiInstaller#removeResource(java.lang.String, String)
 	 */
-	public void removeResource(final String url) {
-        installerThread.removeResource(url);
+	public void removeResource(final String scheme, final String url) {
+        installerThread.removeResource(url, scheme);
 	}
 
 	/**

Modified: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/OsgiInstallerThread.java Tue Aug 10 16:17:19 2010
@@ -33,6 +33,7 @@ import java.util.TreeSet;
 import org.apache.sling.osgi.installer.InstallableResource;
 import org.apache.sling.osgi.installer.OsgiInstaller;
 import org.apache.sling.osgi.installer.OsgiInstallerStatistics;
+import org.apache.sling.osgi.installer.impl.config.ConfigTaskCreator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleEvent;
 import org.osgi.framework.BundleListener;
@@ -134,7 +135,8 @@ class OsgiInstallerThread extends Thread
     }
 
     /** Register a resource for removal, or ignore if we don't have that URL */
-    void removeResource(String url) {
+    void removeResource(String id, final String scheme) {
+        final String url = scheme + ':' + id;
 		// Will mark all resources which have r's URL as uninstallable
         Logger.logDebug("Adding URL " + url + " to urlsToRemove");
 
@@ -145,10 +147,10 @@ class OsgiInstallerThread extends Thread
     }
 
     /** Register a single new resource, will be processed on the next cycle */
-    void addNewResource(final InstallableResource r) {
+    void addNewResource(final InstallableResource r, final String scheme) {
         RegisteredResource rr = null;
         try {
-            rr = new RegisteredResourceImpl(ctx, r);
+            rr = new RegisteredResourceImpl(ctx, r, scheme);
         } catch(IOException ioe) {
             Logger.logWarn("Cannot create RegisteredResource (resource will be ignored):" + r, ioe);
             return;
@@ -165,22 +167,16 @@ class OsgiInstallerThread extends Thread
      *  Used with {@link OsgiInstaller.registerResources}
      */
     void addNewResources(Collection<InstallableResource> data, String urlScheme, BundleContext bundleContext) {
-        // Check scheme, do nothing if at least one of them is wrong
         final SortedSet<RegisteredResource> toAdd = new TreeSet<RegisteredResource>(new RegisteredResourceComparator());
         for(InstallableResource r : data) {
             RegisteredResource rr =  null;
             try {
-                rr = new RegisteredResourceImpl(ctx, r);
+                rr = new RegisteredResourceImpl(ctx, r, urlScheme);
             } catch(IOException ioe) {
                 Logger.logWarn("Cannot create RegisteredResource (resource will be ignored):" + r, ioe);
                 continue;
             }
 
-            if(!rr.getUrlScheme().equals(urlScheme)) {
-                throw new IllegalArgumentException(
-                        "URL of all supplied InstallableResource must start with supplied scheme"
-                        + ", scheme is not '" + urlScheme + "' for URL " + r.getUrl());
-            }
             Logger.logDebug("Adding new resource " + r);
             toAdd.add(rr);
         }

Modified: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparator.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparator.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparator.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparator.java Tue Aug 10 16:17:19 2010
@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.util.Comparator;
 
 import org.apache.sling.osgi.installer.InstallableResource;
+import org.apache.sling.osgi.installer.impl.config.ConfigurationPid;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
 

Modified: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/RegisteredResourceImpl.java Tue Aug 10 16:17:19 2010
@@ -39,6 +39,7 @@ import java.util.jar.JarInputStream;
 import java.util.jar.Manifest;
 
 import org.apache.sling.osgi.installer.InstallableResource;
+import org.apache.sling.osgi.installer.impl.config.ConfigurationPid;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 
@@ -65,11 +66,18 @@ public class RegisteredResourceImpl impl
 	 *  maps to a configuration and the data provides an input stream, it is
 	 *  converted to a Dictionary
 	 */
-	public RegisteredResourceImpl(OsgiInstallerContext osgiCtx, InstallableResource input) throws IOException {
-
+	public RegisteredResourceImpl(final OsgiInstallerContext osgiCtx,
+	        final InstallableResource input,
+	        final String scheme) throws IOException {
+        if ( scheme == null || scheme.length() == 0 ) {
+            throw new IllegalArgumentException("Scheme required");
+        }
+        if ( scheme.indexOf(':') != -1 ) {
+            throw new IllegalArgumentException("Scheme must not contain a colon");
+        }
 	    final BundleContext ctx = osgiCtx.getBundleContext();
-		url = input.getUrl();
-		urlScheme = getUrlScheme(url);
+		url = scheme + ':' + input.getId();
+		urlScheme = scheme;
 		resourceType = input.getType();
 		priority = input.getPriority();
 		serialNumber = getNextSerialNumber();
@@ -94,7 +102,7 @@ public class RegisteredResourceImpl impl
                 final String name = (String)attributes.get(Constants.BUNDLE_SYMBOLICNAME);
                 if(name == null) {
                     // not a bundle - use "jar" entity to make it easier to find out
-                    entity = ENTITY_JAR_PREFIX + input.getUrl();
+                    entity = ENTITY_JAR_PREFIX + url;
                 } else {
                     entity = ENTITY_BUNDLE_PREFIX + name;
                 }
@@ -103,7 +111,7 @@ public class RegisteredResourceImpl impl
             }
 		} else if ( resourceType.equals(InstallableResource.TYPE_CONFIG)) {
             hasDataFile = false;
-            final ConfigurationPid pid = new ConfigurationPid(input.getUrl());
+            final ConfigurationPid pid = new ConfigurationPid(url);
             entity = ENTITY_CONFIG_PREFIX + pid.getCompositePid();
             attributes.put(CONFIG_PID_ATTRIBUTE, pid);
             // config provided as a Dictionary
@@ -269,14 +277,6 @@ public class RegisteredResourceImpl impl
         attributes.put(Constants.BUNDLE_VERSION, v.toString());
     }
 
-    static String getUrlScheme(String url) {
-        final int pos = url.indexOf(':');
-        if(pos <= 0) {
-            throw new IllegalArgumentException("URL does not contain (or starts with) scheme separator ':': " + url);
-        }
-        return url.substring(0, pos);
-    }
-
     public String getUrlScheme() {
         return urlScheme;
     }

Copied: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigTaskCreator.java (from r983998, sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigTaskCreator.java)
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigTaskCreator.java?p2=sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigTaskCreator.java&p1=sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigTaskCreator.java&r1=983998&r2=984106&rev=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigTaskCreator.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigTaskCreator.java Tue Aug 10 16:17:19 2010
@@ -16,17 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.osgi.installer.impl;
+package org.apache.sling.osgi.installer.impl.config;
 
 import java.util.HashMap;
 import java.util.Map;
 import java.util.SortedSet;
 
+import org.apache.sling.osgi.installer.impl.Logger;
+import org.apache.sling.osgi.installer.impl.OsgiInstallerContext;
+import org.apache.sling.osgi.installer.impl.OsgiInstallerTask;
+import org.apache.sling.osgi.installer.impl.RegisteredResource;
 import org.apache.sling.osgi.installer.impl.tasks.ConfigInstallTask;
 import org.apache.sling.osgi.installer.impl.tasks.ConfigRemoveTask;
 
 /** TaskCreator that processes a list of config RegisteredResources */
-class ConfigTaskCreator {
+public class ConfigTaskCreator {
 
     /** Store digests of the installed configs, keyed by config pid */
     private final Map<String, String> digests = new HashMap<String, String>();

Propchange: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigTaskCreator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigTaskCreator.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigurationPid.java (from r983995, sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigurationPid.java)
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigurationPid.java?p2=sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigurationPid.java&p1=sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigurationPid.java&r1=983995&r2=984106&rev=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/ConfigurationPid.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigurationPid.java Tue Aug 10 16:17:19 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.osgi.installer.impl;
+package org.apache.sling.osgi.installer.impl.config;
 
 import java.io.Serializable;
 

Propchange: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigurationPid.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/config/ConfigurationPid.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/AbstractConfigTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/AbstractConfigTask.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/AbstractConfigTask.java (original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/AbstractConfigTask.java Tue Aug 10 16:17:19 2010
@@ -20,10 +20,10 @@ package org.apache.sling.osgi.installer.
 
 import java.io.IOException;
 
-import org.apache.sling.osgi.installer.impl.ConfigurationPid;
 import org.apache.sling.osgi.installer.impl.OsgiInstallerContext;
 import org.apache.sling.osgi.installer.impl.OsgiInstallerTask;
 import org.apache.sling.osgi.installer.impl.RegisteredResource;
+import org.apache.sling.osgi.installer.impl.config.ConfigurationPid;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;

Modified: sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/LocalFileRegisteredResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/LocalFileRegisteredResource.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/LocalFileRegisteredResource.java (original)
+++ sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/LocalFileRegisteredResource.java Tue Aug 10 16:17:19 2010
@@ -27,11 +27,11 @@ import org.osgi.framework.BundleContext;
 /** RegisteredResource that stores data to a local temporary file */
 class LocalFileRegisteredResource extends RegisteredResourceImpl {
 	private File storage;
-	
+
 	LocalFileRegisteredResource(InstallableResource r) throws IOException {
-		super(new MockOsgiInstallerContext(), r);
+		super(new MockOsgiInstallerContext(), r, "test");
 	}
-	
+
 	@Override
 	protected File getDataFile(BundleContext ctx) {
 		if(storage == null) {

Modified: sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparatorTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparatorTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparatorTest.java (original)
+++ sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceComparatorTest.java Tue Aug 10 16:17:19 2010
@@ -51,8 +51,8 @@ public class RegisteredResourceComparato
             data = new Hashtable<String, Object>();
             data.put("foo", "bar");
         }
-        final InstallableResource r = factory.create("test:" + url, null, data, null, null, priority);
-        return new RegisteredResourceImpl(new MockOsgiInstallerContext(), r);
+        final InstallableResource r = factory.create(url, null, data, null, null, priority);
+        return new RegisteredResourceImpl(new MockOsgiInstallerContext(), r, "test");
     }
 
     private void assertOrder(RegisteredResource[] inOrder) {

Modified: sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceTest.java (original)
+++ sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/RegisteredResourceTest.java Tue Aug 10 16:17:19 2010
@@ -125,27 +125,26 @@ public class RegisteredResourceTest {
                 "",
                 ":colonTooEarly",
                 ":colonTooEarlyAgain:",
-                "noColon"
         };
         for(String url : badOnes) {
             try {
-                new RegisteredResourceImpl(new MockOsgiInstallerContext(),factory.create(url, null, new Hashtable<String, Object>(), null, null, null));
+                new RegisteredResourceImpl(new MockOsgiInstallerContext(),
+                        factory.create("test", null, new Hashtable<String, Object>(), null, null, null),
+                        url);
                 fail("Expected bad URL '" + url + "' to throw IllegalArgumentException");
             } catch(IllegalArgumentException asExpected) {
             }
         }
 
         final String [] goodOnes = {
-            "foo:bar",
-            "foo:bar:",
-            "foo::bar",
-            "foo://bar",
+                "noColon"
         };
 
         for(String url : goodOnes) {
             final RegisteredResource r = new RegisteredResourceImpl(new MockOsgiInstallerContext(),
-                    factory.create(url, null, new Hashtable<String, Object>(), "digest1", null, null));
-            assertEquals("Expected scheme 'foo' for URL " + url, "foo", r.getUrlScheme());
+                    factory.create("test", null, new Hashtable<String, Object>(), "digest1", null, null),
+                    url);
+            assertEquals("Expected scheme '" + url + "' for URL " + url, url, r.getUrlScheme());
         }
     }
 }
\ No newline at end of file

Modified: sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/TaskOrderingTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/TaskOrderingTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/TaskOrderingTest.java (original)
+++ sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/TaskOrderingTest.java Tue Aug 10 16:17:19 2010
@@ -51,7 +51,9 @@ public class TaskOrderingTest {
 	}
 
 	private static RegisteredResource getRegisteredResource(String url) throws IOException {
-		return new RegisteredResourceImpl(new MockOsgiInstallerContext(), factory.create(url, null, new Hashtable<String, Object>(), null, null, null));
+		return new RegisteredResourceImpl(new MockOsgiInstallerContext(),
+		        factory.create(url, null, new Hashtable<String, Object>(), null, null, null),
+		        "test");
 	}
 
 	private void assertOrder(int testId, Collection<OsgiInstallerTask> actual, OsgiInstallerTask [] expected) {

Modified: sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/tasks/ConfigurationPidTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/tasks/ConfigurationPidTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/tasks/ConfigurationPidTest.java (original)
+++ sling/trunk/installer/osgi/installer/src/test/java/org/apache/sling/osgi/installer/impl/tasks/ConfigurationPidTest.java Tue Aug 10 16:17:19 2010
@@ -20,7 +20,7 @@ package org.apache.sling.osgi.installer.
 
 import static org.junit.Assert.assertEquals;
 
-import org.apache.sling.osgi.installer.impl.ConfigurationPid;
+import org.apache.sling.osgi.installer.impl.config.ConfigurationPid;
 
 public class ConfigurationPidTest {
 

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleDependenciesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleDependenciesTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleDependenciesTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleDependenciesTest.java Tue Aug 10 16:17:19 2010
@@ -58,7 +58,7 @@ public class BundleDependenciesTest exte
         // without testB, needsB must not start
         {
             resetCounters();
-            installer.addResource(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-needsB.jar")));
+            installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-needsB.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 2);
             assertBundle(needsB + " must not be started, testB not present", needsB, null, Bundle.INSTALLED);
         }
@@ -66,7 +66,7 @@ public class BundleDependenciesTest exte
        // now install testB -> needsB must start
         {
             resetCounters();
-            installer.addResource(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testB-1.0.jar")));
+            installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testB-1.0.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 2);
             assertNotNull(testB + " must be installed", findBundle(testB));
             assertBundle(needsB + " must be started now that testB is installed", needsB, null, Bundle.ACTIVE);

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallStressTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallStressTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallStressTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallStressTest.java Tue Aug 10 16:17:19 2010
@@ -170,7 +170,7 @@ public class BundleInstallStressTest ext
     	for(File f : bundles) {
     		toInstall.add(getInstallableResource(f, f.getAbsolutePath() + f.lastModified()));
     	}
-    	installer.registerResources(toInstall, URL_SCHEME);
+    	installer.registerResources(URL_SCHEME, toInstall);
     }
 
     private void expectBundleCount(String info, final int nBundles) throws Exception {

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallUpgradeDowngradeTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallUpgradeDowngradeTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallUpgradeDowngradeTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleInstallUpgradeDowngradeTest.java Tue Aug 10 16:17:19 2010
@@ -58,7 +58,7 @@ public class BundleInstallUpgradeDowngra
     	{
             assertNull("Test bundle must be absent before installing", findBundle(symbolicName));
     	    resetCounters();
-    	    installer.addResource(getInstallableResource(
+    	    installer.addResource(URL_SCHEME, getInstallableResource(
     	            getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
     	    final Bundle b = assertBundle("After installing", symbolicName, "1.1", Bundle.ACTIVE);
@@ -70,7 +70,7 @@ public class BundleInstallUpgradeDowngra
     	// Upgrade to later version, verify
     	{
     	    resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar"), "digestA"));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         	final Bundle b = assertBundle("After updating to 1.2", symbolicName, "1.2", Bundle.ACTIVE);
@@ -82,7 +82,7 @@ public class BundleInstallUpgradeDowngra
     	// Downgrade to lower version, installed bundle must not change
         {
             resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar"), "digestA"));
 
             // make sure no updates happen
@@ -100,7 +100,7 @@ public class BundleInstallUpgradeDowngra
     	// Update to same version with different digest must be ignored
     	{
     	    resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar"), "digestB"));
         	assertNoOsgiTasks("Update to same version should generate no OSGi tasks");
     	}
@@ -108,17 +108,17 @@ public class BundleInstallUpgradeDowngra
     	// Uninstall
     	{
             resetCounters();
-            installer.removeResource(getNonInstallableResourceUrl(
+            installer.removeResource(URL_SCHEME, getNonInstallableResourceUrl(
                     getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
             resetCounters();
-            installer.removeResource(getNonInstallableResourceUrl(
+            installer.removeResource(URL_SCHEME, getNonInstallableResourceUrl(
                     getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
             resetCounters();
-            installer.removeResource(getNonInstallableResourceUrl(
+            installer.removeResource(URL_SCHEME, getNonInstallableResourceUrl(
                     getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
@@ -135,7 +135,7 @@ public class BundleInstallUpgradeDowngra
     	// Reinstall lower version, must work
         {
             resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
             assertBundle("After reinstalling 1.1", symbolicName, "1.1", Bundle.ACTIVE);
@@ -152,7 +152,7 @@ public class BundleInstallUpgradeDowngra
 	        {
 	            assertNull("Test bundle must be absent before installing", findBundle(symbolicName));
 	            resetCounters();
-	            installer.addResource(getInstallableResource(
+	            installer.addResource(URL_SCHEME, getInstallableResource(
 	                    getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
 	            waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 	            assertBundle("After installing", symbolicName, "1.1", Bundle.ACTIVE);
@@ -162,7 +162,7 @@ public class BundleInstallUpgradeDowngra
 
             {
                 resetCounters();
-                installer.removeResource(getNonInstallableResourceUrl(
+                installer.removeResource(URL_SCHEME, getNonInstallableResourceUrl(
                         getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
                 waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
                 assertNull("Test bundle must be gone", findBundle(symbolicName));
@@ -172,7 +172,7 @@ public class BundleInstallUpgradeDowngra
 
             {
                 resetCounters();
-                installer.addResource(getInstallableResource(
+                installer.addResource(URL_SCHEME, getInstallableResource(
                         getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
                 waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
                 assertBundle("After reinstalling", symbolicName, "1.1", Bundle.ACTIVE);

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundlePrioritiesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundlePrioritiesTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundlePrioritiesTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundlePrioritiesTest.java Tue Aug 10 16:17:19 2010
@@ -59,21 +59,21 @@ public class BundlePrioritiesTest extend
 
         {
             resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-snap.jar"), "digest1"));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
             assertBundle("Initial install", symbolicName, null, Bundle.ACTIVE);
         }
 
         {
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-snap.jar"), "digest2", lowPriority));
             assertNoOsgiTasks("Low-priority snapshot updated must be ignored");
         }
 
         {
             resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-snap.jar"), "digest3", highPriority));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         }

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleSnapshotUpdateTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleSnapshotUpdateTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleSnapshotUpdateTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleSnapshotUpdateTest.java Tue Aug 10 16:17:19 2010
@@ -60,7 +60,7 @@ public class BundleSnapshotUpdateTest ex
         final String symbolicName = "osgi-installer-testbundle";
         assertNull("Test bundle must be absent before installing", findBundle(symbolicName));
         resetCounters();
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar"), "digest1"));
         // wait for two tasks: install and start
         waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 2);
@@ -70,7 +70,7 @@ public class BundleSnapshotUpdateTest ex
 
         // Update with same digest must be ignored
         long nOps = statistics.getCounters()[OsgiInstallerStatistics.OSGI_TASKS_COUNTER];
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar"), "digest1"));
         waitForInstallerAction(OsgiInstallerStatistics.INSTALLER_CYCLES_COUNTER, 1);
         assertEquals("Updating testbundle with same digest must not generate any OSGi tasks",
@@ -78,7 +78,7 @@ public class BundleSnapshotUpdateTest ex
 
         // Update with different digest must be ignored
         nOps = statistics.getCounters()[OsgiInstallerStatistics.OSGI_TASKS_COUNTER];
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar"), "digest2"));
         waitForInstallerAction(OsgiInstallerStatistics.INSTALLER_CYCLES_COUNTER, 1);
         assertEquals("Updating testbundle with different digest must not generate any OSGi tasks",
@@ -93,7 +93,7 @@ public class BundleSnapshotUpdateTest ex
         final String symbolicName = "osgi-installer-snapshot-test";
         assertNull("Snapshot test bundle must be absent before installing", findBundle(symbolicName));
         resetCounters();
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-snap.jar"), "digest1"));
         // wait for two tasks: install and start
         waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 2);
@@ -106,7 +106,7 @@ public class BundleSnapshotUpdateTest ex
 
         // Update with same digest must be ignored
         final long nOps = statistics.getCounters()[OsgiInstallerStatistics.OSGI_TASKS_COUNTER];
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-snap.jar"), "digest1"));
         waitForInstallerAction(OsgiInstallerStatistics.INSTALLER_CYCLES_COUNTER, 3);
         assertEquals("Updating snapshot bundle with same digest must not generate any OSGi tasks",
@@ -114,7 +114,7 @@ public class BundleSnapshotUpdateTest ex
 
         // Update with different digest must generate an OSGi update
         resetCounters();
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-snap.jar"), "digest2"));
         // update also generates a start task, as the bundle was started before, and a framework refresh
         waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 3);

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStartRetriesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStartRetriesTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStartRetriesTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStartRetriesTest.java Tue Aug 10 16:17:19 2010
@@ -40,7 +40,7 @@ public class BundleStartRetriesTest exte
         // without testB, needsB must not start
         resetCounters();
         final long nOps = statistics.getCounters()[OsgiInstallerStatistics.OSGI_TASKS_COUNTER];
-        installer.addResource(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-needsB.jar")));
+        installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-needsB.jar")));
         waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 2);
         assertBundle(needsB + " must not be started, testB not present", needsB, null, Bundle.INSTALLED);
 

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStatePreservedTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStatePreservedTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStatePreservedTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/BundleStatePreservedTest.java Tue Aug 10 16:17:19 2010
@@ -51,13 +51,13 @@ public class BundleStatePreservedTest ex
     	// Install two bundles, one started, one stopped
     	{
             resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-testA-1.0.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 2);
     	}
         {
             resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-testB-1.0.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 2);
             final Bundle b = findBundle("osgi-installer-testB");
@@ -69,10 +69,10 @@ public class BundleStatePreservedTest ex
         assertBundle("Bundle B must be stopped", "osgi-installer-testB", null, Bundle.RESOLVED);
 
     	// Execute some OsgiController operations
-        installer.addResource(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar")));
-        installer.addResource(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
+        installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar")));
+        installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
         resetCounters();
-        installer.addResource(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
+        installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         assertBundle("After installing testbundle", "osgi-installer-testbundle", "1.2", Bundle.ACTIVE);
 
@@ -81,15 +81,15 @@ public class BundleStatePreservedTest ex
         assertCounter(OsgiInstallerStatistics.REGISTERED_GROUPS_COUNTER, 3);
 
         resetCounters();
-        installer.removeResource(getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar")));
+        installer.removeResource(URL_SCHEME, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar")));
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
         resetCounters();
-        installer.removeResource(getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
+        installer.removeResource(URL_SCHEME, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
         resetCounters();
-        installer.removeResource(getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
+        installer.removeResource(URL_SCHEME, getNonInstallableResourceUrl(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
         assertNull("testbundle must be gone at end of test", findBundle("osgi-installer-testbundle"));

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigInstallTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigInstallTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigInstallTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigInstallTest.java Tue Aug 10 16:17:19 2010
@@ -83,26 +83,26 @@ public class ConfigInstallTest extends O
         assertNull("Config " + cfgPid + " must not be found before test", findConfiguration(cfgPid));
 
         resetCounters();
-        installer.addResource(r);
+        installer.addResource(URL_SCHEME, r);
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
         Configuration cfg = waitForConfiguration("After installing", cfgPid, TIMEOUT, true);
         assertEquals("Config value must match", "bar", cfg.getProperties().get("foo"));
 
         resetCounters();
-        installer.removeResource(r.getUrl());
+        installer.removeResource(URL_SCHEME, r.getId());
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         waitForConfiguration("After removing", cfgPid, TIMEOUT, false);
 
         // Reinstalling with same digest must work
         resetCounters();
-        installer.addResource(r);
+        installer.addResource(URL_SCHEME, r);
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         cfg = waitForConfiguration("After reinstalling", cfgPid, TIMEOUT, true);
         assertEquals("Config value must match", "bar", cfg.getProperties().get("foo"));
 
         resetCounters();
-        installer.removeResource(r.getUrl());
+        installer.removeResource(URL_SCHEME, r.getId());
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         waitForConfiguration("After removing for the second time", cfgPid, TIMEOUT, false);
 
@@ -132,7 +132,7 @@ public class ConfigInstallTest extends O
     	waitForConfigAdmin(false);
         resetCounters();
         final InstallableResource r = getInstallableResource(cfgPid, cfgData);
-        installer.addResource(r);
+        installer.addResource(URL_SCHEME, r);
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         sleep(1000L);
         configAdmin.start();
@@ -144,7 +144,7 @@ public class ConfigInstallTest extends O
         configAdmin.stop();
         waitForConfigAdmin(false);
         resetCounters();
-        installer.removeResource(r.getUrl());
+        installer.removeResource(URL_SCHEME, r.getId());
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         sleep(1000L);
         resetCounters();
@@ -171,7 +171,7 @@ public class ConfigInstallTest extends O
         waitForCondition("Expected two ConfigurationEvents since beginning of test", TIMEOUT, cond);
 
         long nOps = statistics.getCounters()[OsgiInstallerStatistics.OSGI_TASKS_COUNTER];
-        installer.addResource(getInstallableResource(cfgPid, cfgData));
+        installer.addResource(URL_SCHEME, getInstallableResource(cfgPid, cfgData));
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         assertEquals("Registering a Configuration that's already installed must not generate OSGi tasks",
                 nOps, statistics.getCounters()[OsgiInstallerStatistics.OSGI_TASKS_COUNTER]);
@@ -179,7 +179,7 @@ public class ConfigInstallTest extends O
 
     	// Reinstalling with a change must be executed
         cfgData.put("foo", "changed");
-        installer.addResource(getInstallableResource(cfgPid, cfgData));
+        installer.addResource(URL_SCHEME, getInstallableResource(cfgPid, cfgData));
         waitForConfigValue("After changing value", cfgPid, TIMEOUT, "foo", "changed");
 		cond = new Condition() { public boolean isTrue() { return events.size() == 2; }};
         waitForCondition("Expected two ConfigurationEvents since beginning of test", TIMEOUT, cond);

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigPrioritiesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigPrioritiesTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigPrioritiesTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ConfigPrioritiesTest.java Tue Aug 10 16:17:19 2010
@@ -78,16 +78,16 @@ public class ConfigPrioritiesTest extend
         data.put("foo", "c");
         final InstallableResource c = getInstallableResource(pid, data, InstallableResourceFactory.DEFAULT_PRIORITY + 1);
 
-        installer.addResource(b);
+        installer.addResource(URL_SCHEME, b);
         assertConfigValue(pid, "foo", "b", TIMEOUT);
-        installer.addResource(c);
+        installer.addResource(URL_SCHEME, c);
         assertConfigValue(pid, "foo", "c", TIMEOUT);
-        installer.addResource(a);
-        installer.removeResource(c.getUrl());
+        installer.addResource(URL_SCHEME, a);
+        installer.removeResource(URL_SCHEME, c.getId());
         assertConfigValue(pid, "foo", "b", TIMEOUT);
-        installer.removeResource(b.getUrl());
+        installer.removeResource(URL_SCHEME, b.getId());
         assertConfigValue(pid, "foo", "a", TIMEOUT);
-        installer.removeResource(a.getUrl());
+        installer.removeResource(URL_SCHEME, a.getId());
         waitForConfiguration("After removing all resources", pid, TIMEOUT, false);
     }
 }

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ContextBundleUpdateTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ContextBundleUpdateTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ContextBundleUpdateTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/ContextBundleUpdateTest.java Tue Aug 10 16:17:19 2010
@@ -58,7 +58,7 @@ public class ContextBundleUpdateTest ext
         final String symbolicName = "osgi-installer-testbundle";
         assertNull("Test bundle must be absent before installing", findBundle(symbolicName));
         resetCounters();
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar"), "digest0"));
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         final Bundle b = assertBundle("After initial install", symbolicName, "1.0", Bundle.ACTIVE);
@@ -75,7 +75,7 @@ public class ContextBundleUpdateTest ext
         // Install another bundle (to trigger installer queue activity), wait
         // for installer to be idle and check version
         resetCounters();
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-snap.jar"), "digest1"));
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         assertBundle("-snap bundle install", "osgi-installer-snapshot-test", null, Bundle.ACTIVE);

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/InvalidBundlesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/InvalidBundlesTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/InvalidBundlesTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/InvalidBundlesTest.java Tue Aug 10 16:17:19 2010
@@ -62,7 +62,7 @@ public class InvalidBundlesTest extends 
                 getTestBundle(BUNDLE_BASE_NAME + "-testB-1.0.jar")));
 
         resetCounters();
-        installer.registerResources(data, URL_SCHEME);
+        installer.registerResources(URL_SCHEME, data);
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
         final String info = "All valid bundles must be installed";
@@ -83,7 +83,7 @@ public class InvalidBundlesTest extends 
     	{
             assertNull("Test bundle must be absent before installing", findBundle(symbolicName));
     	    resetCounters();
-    	    installer.addResource(getInstallableResource(
+    	    installer.addResource(URL_SCHEME, getInstallableResource(
     	            getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
     	    assertBundle("After installing", symbolicName, "1.1", Bundle.ACTIVE);
@@ -94,7 +94,7 @@ public class InvalidBundlesTest extends 
     	// Non-bundle must be ignored
     	{
             resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-notabundle.jar")));
             assertNoOsgiTasks("After installing non-bundle jar");
     	}
@@ -104,7 +104,7 @@ public class InvalidBundlesTest extends 
         // Invalid archive must be ignored
         {
             resetCounters();
-            installer.addResource(getInstallableResource(getTestBundle("test-classes/invalid-jar.jar")));
+            installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle("test-classes/invalid-jar.jar")));
             assertNoOsgiTasks("After installing invalid jar");
         }
 
@@ -113,7 +113,7 @@ public class InvalidBundlesTest extends 
     	// Make sure controller is not blocked, by testing an upgrade
     	{
     	    resetCounters();
-            installer.addResource(getInstallableResource(
+            installer.addResource(URL_SCHEME, getInstallableResource(
                     getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         	assertBundle("After updating to 1.2", symbolicName, "1.2", Bundle.ACTIVE);

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/MockInstallableResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/MockInstallableResource.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/MockInstallableResource.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/MockInstallableResource.java Tue Aug 10 16:17:19 2010
@@ -123,7 +123,7 @@ public class MockInstallableResource imp
         return this.type;
     }
 
-    public String getUrl() {
+    public String getId() {
         return this.uri;
     }
 

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/OsgiInstallerTestBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/OsgiInstallerTestBase.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/OsgiInstallerTestBase.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/OsgiInstallerTestBase.java Tue Aug 10 16:17:19 2010
@@ -273,7 +273,7 @@ class OsgiInstallerTestBase implements F
     }
 
     protected String getNonInstallableResourceUrl(File testBundle) throws IOException {
-    	return URL_SCHEME + ":" + testBundle.getAbsolutePath();
+    	return testBundle.getAbsolutePath();
     }
 
     protected InstallableResource getInstallableResource(File testBundle, String digest) throws IOException {
@@ -281,7 +281,7 @@ class OsgiInstallerTestBase implements F
     }
 
     protected InstallableResource getInstallableResource(File testBundle, String digest, int priority) throws IOException {
-        final String url = URL_SCHEME + ":" + testBundle.getAbsolutePath();
+        final String url = testBundle.getAbsolutePath();
         if(digest == null) {
             digest = testBundle.getAbsolutePath() + testBundle.lastModified();
         }
@@ -294,7 +294,7 @@ class OsgiInstallerTestBase implements F
     }
 
     protected InstallableResource getInstallableResource(String configPid, Dictionary<String, Object> data, int priority) {
-        final InstallableResource result = new MockInstallableResource(URL_SCHEME + ":/" + configPid, data, null, null, priority);
+        final InstallableResource result = new MockInstallableResource("/" + configPid, data, null, null, priority);
         return result;
     }
 

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RegisterResourcesTest.java Tue Aug 10 16:17:19 2010
@@ -66,7 +66,7 @@ public class RegisterResourcesTest exten
         r.add(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
         r.add(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
 
-        installer.registerResources(r, URL_SCHEME);
+        installer.registerResources(URL_SCHEME, r);
 
         // Wait for worker thread to wake up and become idle once
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
@@ -87,7 +87,7 @@ public class RegisterResourcesTest exten
             r.add(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar")));
             r.add(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
 
-            installer.registerResources(r, URL_SCHEME);
+            installer.registerResources(URL_SCHEME, r);
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
             final String info = "After initial registration";
@@ -99,7 +99,7 @@ public class RegisterResourcesTest exten
         {
             // Add test 1.2 in between, to make sure it disappears in next registerResources call
             resetCounters();
-            installer.addResource(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
+            installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
             assertBundle("After adding testbundle V1.2", "osgi-installer-testbundle", "1.2", Bundle.ACTIVE);
         }
@@ -107,8 +107,8 @@ public class RegisterResourcesTest exten
         {
             // Add a bundle with different URL scheme - must not be removed by registerResources
             resetCounters();
-            installer.addResource(new MockInstallableResource(
-                    "anotherscheme:testA.jar",
+            installer.addResource("anotherscheme", new MockInstallableResource(
+                    "osgi-installer-testA.jar",
                     new FileInputStream(getTestBundle(BUNDLE_BASE_NAME + "-testA-1.0.jar")),
                     "digest1", null, null));
             waitForInstallerAction(OsgiInstallerStatistics.OSGI_TASKS_COUNTER, 2);
@@ -123,7 +123,7 @@ public class RegisterResourcesTest exten
             r.add(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar")));
             r.add(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-snap.jar"), "digest1"));
 
-            installer.registerResources(r, URL_SCHEME);
+            installer.registerResources(URL_SCHEME, r);
             waitForInstallerAction(OsgiInstallerStatistics.INSTALLER_CYCLES_COUNTER, 2);
 
             assertBundle("Snapshot bundle must be started",
@@ -140,8 +140,8 @@ public class RegisterResourcesTest exten
 
         {
             // Re-add the missing bundles and recheck
-            installer.addResource(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testB-1.0.jar")));
-            installer.addResource(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
+            installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testB-1.0.jar")));
+            installer.addResource(URL_SCHEME, getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.2.jar")));
 
             waitForInstallerAction(OsgiInstallerStatistics.INSTALLER_CYCLES_COUNTER, 2);
 
@@ -168,7 +168,7 @@ public class RegisterResourcesTest exten
             r.add(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.0.jar")));
             r.add(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
 
-            installer.registerResources(r, URL_SCHEME);
+            installer.registerResources(URL_SCHEME, r);
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
 
             final String info = "After initial registration";
@@ -179,7 +179,7 @@ public class RegisterResourcesTest exten
 
         {
         	resetCounters();
-        	installer.registerResources(new LinkedList<InstallableResource>(), URL_SCHEME);
+        	installer.registerResources(URL_SCHEME, new LinkedList<InstallableResource>());
             waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
             assertNull("After registration with no resources, testB bundle must be gone", findBundle("osgi-installer-testB"));
             assertNull("After registration with no resources, testB bundle must be gone", findBundle("osgi-installer-needsB"));

Modified: sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RemovedResourceDetectionTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RemovedResourceDetectionTest.java?rev=984106&r1=984105&r2=984106&view=diff
==============================================================================
--- sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RemovedResourceDetectionTest.java (original)
+++ sling/trunk/installer/osgi/it/src/test/java/org/apache/sling/osgi/installer/it/RemovedResourceDetectionTest.java Tue Aug 10 16:17:19 2010
@@ -61,14 +61,14 @@ public class RemovedResourceDetectionTes
         // Install two bundles and verify
         assertNull(symbolicNameA + " must be absent before installing", findBundle(symbolicNameA));
         resetCounters();
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-testbundle-1.1.jar")));
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         assertBundle("After initial install", symbolicNameA, "1.1", Bundle.ACTIVE);
 
         assertNull(symbolicNameB + " must be absent before installing", findBundle(symbolicNameB));
         resetCounters();
-        installer.addResource(getInstallableResource(
+        installer.addResource(URL_SCHEME, getInstallableResource(
                 getTestBundle(BUNDLE_BASE_NAME + "-testB-1.0.jar")));
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         assertBundle("After initial install", symbolicNameB, "1.0", Bundle.ACTIVE);
@@ -78,7 +78,7 @@ public class RemovedResourceDetectionTes
         resetCounters();
         final List<InstallableResource> data = new ArrayList<InstallableResource>();
         data.add(getInstallableResource(getTestBundle(BUNDLE_BASE_NAME + "-testB-1.0.jar")));
-        installer.registerResources(data, URL_SCHEME);
+        installer.registerResources(URL_SCHEME, data);
         sleep(500);
         waitForInstallerAction(OsgiInstallerStatistics.WORKER_THREAD_BECOMES_IDLE_COUNTER, 1);
         assertBundle("After installer restart", symbolicNameB, "1.0", Bundle.ACTIVE);



Mime
View raw message