felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1628547 [1/2] - in /felix/sandbox/pderop/dependencymanager-prototype: cnf/ org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests...
Date Tue, 30 Sep 2014 20:30:23 GMT
Author: pderop
Date: Tue Sep 30 20:30:21 2014
New Revision: 1628547

URL: http://svn.apache.org/r1628547
Log:
big/major commit:

* FELIX-4426: Allow DM to manage collections of services.
* Added AutoConfigTest for the FELIX-4426 issue.
* Added many tests using parallel DM.
* Optimization: nearly 33% of performance gain (the benchmark is proving this).
* Cleaned imports.
* Cleaned samples and added an example using annotations.


Added:
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AutoConfigTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AdapterAnnotationParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleAnnotationParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParalleTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/BundleDependencyAnnotationParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/CompositeAnnotationsParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ExtraServicePropertiesParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/FactoryConfigurationAdapterAnnotationParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/Felix4357ParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/MultipleAnnotationsParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PropagateAnnotationParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PublisherAnnotationParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/SimpleAnnotationsParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/TemporalAnnotationsParallelTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.annot.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/hello.annot.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/Activator.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessConsumer.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceParameterImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceConsumer.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProvider.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProviderImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationEventImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FieldUtil.java
Removed:
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/impl/Activator.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/impl/DeviceAccessConsumer.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/impl/DeviceAccessImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/impl/DeviceImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/impl/DeviceParameterImpl.java
Modified:
    felix/sandbox/pderop/dependencymanager-prototype/cnf/build.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AbstractServiceDependencyTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithModifiedInstanceBoundDependencyTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithPropagationTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectBaseTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectRaceTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ComponentTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithAutoConfigTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithCallbackTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2369_ExtraDependencyTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX4361_ConcurrentComponentListingTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/InstanceBoundDependencyTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/MultipleExtraDependenciesTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceDependencyInjectionTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceRaceTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceTrackerTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/TemporalServiceDependencyTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ResourceAnnotationTest.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/device.bnd
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/.classpath
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/Event.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleEventImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/DependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/EventImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceEventImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceEventImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceUtil.java

Modified: felix/sandbox/pderop/dependencymanager-prototype/cnf/build.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/cnf/build.bnd?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/cnf/build.bnd (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/cnf/build.bnd Tue Sep 30 20:30:21 2014
@@ -30,8 +30,10 @@
 ## Java Compiler Options
 #java:                  java
 #javac:                 javac
-#javac.source:          1.5
-#javac.target:          1.5
+
+javac.source:          1.7
+javac.target:          1.7
+
 #javac.debug:           on
 
 ## Bnd Options

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AbstractServiceDependencyTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AbstractServiceDependencyTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AbstractServiceDependencyTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AbstractServiceDependencyTest.java Tue Sep 30 20:30:21 2014
@@ -18,11 +18,11 @@
  */
 package org.apache.felix.dm.itest;
 
+import junit.framework.Assert;
+
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 
-import junit.framework.Assert;
-
 public class AbstractServiceDependencyTest extends TestBase {
    public void testAbstractClassDependency() {
        DependencyManager m = getDM();

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithModifiedInstanceBoundDependencyTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithModifiedInstanceBoundDependencyTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithModifiedInstanceBoundDependencyTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithModifiedInstanceBoundDependencyTest.java Tue Sep 30 20:30:21 2014
@@ -22,11 +22,11 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Map;
 
+import junit.framework.Assert;
+
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 
-import junit.framework.Assert;
-
 /**
  * Test for FELIX-4334 issue.
  * 

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithPropagationTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithPropagationTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithPropagationTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AdapterWithPropagationTest.java Tue Sep 30 20:30:21 2014
@@ -22,11 +22,11 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Map;
 
+import junit.framework.Assert;
+
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 
-import junit.framework.Assert;
-
 /**
  * Checks if a service adapter propagates its service properties, if 
  * the adapted service properties are changed:

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectBaseTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectBaseTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectBaseTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectBaseTest.java Tue Sep 30 20:30:21 2014
@@ -29,7 +29,7 @@ public class AspectBaseTest extends Test
                 .setService(ServiceInterface.class)
                 .setRequired(true)
                 .setCallbacks("add", "remove")
-                .setAutoConfig(true)
+                .setAutoConfig("m_service")
             );
         Component sa = m.createAspectService(ServiceInterface.class, null, 20, null)
             .setImplementation(ServiceAspect.class);
@@ -63,7 +63,7 @@ public class AspectBaseTest extends Test
         ServiceProvider p = new ServiceProvider(e, "a");
         ServiceConsumer c = new ServiceConsumer(e);
         Component sp = m.createComponent().setImplementation(p).setInterface(ServiceInterface.class.getName(), new Properties() {{ put("name", "a"); }});
-        Component sc = m.createComponent().setImplementation(c).add(m.createServiceDependency().setService(ServiceInterface.class).setRequired(true).setCallbacks("add", "remove").setAutoConfig(true));
+        Component sc = m.createComponent().setImplementation(c).add(m.createServiceDependency().setService(ServiceInterface.class).setRequired(true).setCallbacks("add", "remove").setAutoConfig("m_service"));
         Component sa = m.createAspectService(ServiceInterface.class, null, 20, null).setImplementation(ServiceAspect.class);
         // we first add the aspect
         m.add(sa);

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectRaceTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectRaceTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectRaceTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AspectRaceTest.java Tue Sep 30 20:30:21 2014
@@ -10,7 +10,6 @@ import java.util.concurrent.TimeUnit;
 import junit.framework.Assert;
 
 import org.apache.felix.dm.Component;
-import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.ServiceDependency;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AutoConfigTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AutoConfigTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AutoConfigTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/AutoConfigTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,225 @@
+package org.apache.felix.dm.itest;
+
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import junit.framework.Assert;
+
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.Constants;
+
+public class AutoConfigTest extends TestBase {
+    private final Ensure m_ensure = new Ensure();
+
+    public void testField() throws Exception {
+        final DependencyManager dm = getDM();
+        // Create a consumer, depending on some providers (autoconfig field).
+        ConsumerField consumer = new ConsumerField();
+        Component c = createConsumer(dm, consumer);
+        // Create two providers
+        Component p1 = createProvider(dm, 10, new Provider() {
+            public String toString() { return "provider1"; }
+            public void run() { m_ensure.step(); }
+        });
+        Component p2 = createProvider(dm, 20, new Provider() {
+            public String toString() { return "provider2"; }
+            public void run() { m_ensure.step(); }
+        });
+
+        // add the two providers
+        dm.add(p2);
+        dm.add(p1);
+        // add the consumer, which should have been injected with provider2 (highest rank)
+        dm.add(c);
+        m_ensure.waitForStep(1, 5000);
+        // remove the provider2, the consumer should now be injected with provider1
+        dm.remove(p2);
+        Assert.assertNotNull(consumer.getProvider());
+        Assert.assertEquals("provider1", consumer.getProvider().toString());
+        // remove the provider1, the consumer should have been stopped
+        dm.remove(p1);
+        m_ensure.waitForStep(2, 5000);
+    }
+    
+    public void testCollectionField() throws Exception {
+        final DependencyManager dm = getDM();
+        ConsumerCollection consumer = new ConsumerCollection();
+        Component c = createConsumer(dm, consumer);
+        Component p1 = createProvider(dm, 10, new Provider() {
+            public void run() { m_ensure.step(); }
+            public String toString() { return "provider1"; }
+        });
+        Component p2 = createProvider(dm, 20, new Provider() {
+            public void run() { m_ensure.step();}
+            public String toString() { return "provider2"; }
+        });
+
+        dm.add(p2);
+        dm.add(p1);
+        dm.add(c);
+        // the consumer should have been injected with all providers.
+        m_ensure.waitForStep(3, 5000);
+        
+        // check if all providers are there
+        Assert.assertNotNull(consumer.getProvider("provider1"));
+        Assert.assertNotNull(consumer.getProvider("provider2"));
+        
+        // remove provider1
+        dm.remove(p1);
+        
+        // check if provider1 has been removed and if provider2 is still there
+        Assert.assertNull(consumer.getProvider("provider1"));
+        Assert.assertNotNull(consumer.getProvider("provider2"));
+
+        // remove provider2, the consumer should be stopped
+        dm.remove(p2);
+        m_ensure.waitForStep(4, 5000);
+    }   
+    
+    public void testMapField() throws Exception {
+        final DependencyManager dm = getDM();
+        ConsumerMap consumer = new ConsumerMap();
+        Component c = createConsumer(dm, consumer);
+        Component p1 = createProvider(dm, 10, new Provider() {
+            public void run() { m_ensure.step(); }
+            public String toString() { return "provider1"; }
+        });
+        Component p2 = createProvider(dm, 20, new Provider() {
+            public void run() { m_ensure.step();}
+            public String toString() { return "provider2"; }
+        });
+
+        dm.add(p2);
+        dm.add(p1);
+        dm.add(c);
+        // the consumer should have been injected with all providers.
+        m_ensure.waitForStep(3, 5000);
+        
+        // check if all providers are there
+        Assert.assertNotNull(consumer.getProvider("provider1"));
+        Assert.assertNotNull(consumer.getProvider("provider2"));
+        
+        // remove provider1
+        dm.remove(p1);
+        
+        // check if provider1 has been removed and if provider2 is still there
+        Assert.assertNull(consumer.getProvider("provider1"));
+        Assert.assertNotNull(consumer.getProvider("provider2"));
+
+        // remove provider2, the consumer should be stopped
+        dm.remove(p2);
+        m_ensure.waitForStep(4, 5000);
+    }
+
+    private Component createProvider(DependencyManager dm, int rank, Provider provider) {
+        Properties props = new Properties();
+        props.put(Constants.SERVICE_RANKING, new Integer(rank));
+        return dm.createComponent()
+            .setImplementation(provider)
+            .setInterface(Provider.class.getName(), props);
+    }
+
+    private Component createConsumer(DependencyManager dm, Object consumer) {
+        return dm.createComponent()
+            .setImplementation(consumer)
+            .add(dm.createServiceDependency().setService(Provider.class).setRequired(true));
+    }
+
+    public static interface Provider extends Runnable {      
+    }
+    
+    public class ConsumerField {
+        volatile Provider m_provider;
+        
+        void start() {
+            Assert.assertNotNull(m_provider);
+            Assert.assertEquals("provider2", m_provider.toString());
+            m_ensure.step(1);
+        }
+        
+        public Provider getProvider() {
+            return m_provider;
+        }
+
+        void stop() {
+            m_ensure.step(2);
+        }
+    }
+    
+    public class ConsumerCollection {
+        volatile ConcurrentLinkedQueue<Provider> m_providers;
+        
+        void start() {
+            Assert.assertNotNull(m_providers);
+            Assert.assertTrue(m_providers.size() == 2);
+            for (Provider provider : m_providers) {
+                provider.run();
+            }
+            m_ensure.step(3);
+        }
+        
+        public Provider getProvider(String name) {
+            System.out.println("getProvider(" + name + ") : proviers=" + m_providers);
+            for (Provider provider : m_providers) {
+                if (provider.toString().equals(name)) {
+                    return provider;
+                }
+            }
+            return null;
+        }
+
+        Collection<Provider> getProviders() {
+            return m_providers;
+        }
+        
+        void stop() {
+            m_ensure.step(4);
+        }
+    }    
+    
+    public class ConsumerMap {
+        volatile ConcurrentHashMap<Provider, Dictionary> m_providers;
+        
+        void start() {
+            Assert.assertNotNull(m_providers);
+            System.out.println("ConsumerMap.start: injected providers=" + m_providers);
+            Assert.assertTrue(m_providers.size() == 2);
+            for (Provider provider : m_providers.keySet()) {
+                provider.run();
+
+                if (provider.toString().equals("provider1")) {
+                    Assert.assertEquals(m_providers.get(provider).get(Constants.SERVICE_RANKING), 10);
+                } else if (provider.toString().equals("provider2")) {
+                    Assert.assertEquals(m_providers.get(provider).get(Constants.SERVICE_RANKING), 20);
+                } else {
+                    Assert.fail("Did not find any properties for provider " + provider);
+                }
+            }
+            
+            m_ensure.step(3);
+        }
+        
+        public Provider getProvider(String name) {
+            System.out.println("getProvider(" + name + ") : providers=" + m_providers);
+            for (Provider provider : m_providers.keySet()) {
+                if (provider.toString().equals(name)) {
+                    return provider;
+                }
+            }
+            return null;
+        }
+
+        Map<Provider, Dictionary> getProviders() {
+            return m_providers;
+        }
+        
+        void stop() {
+            m_ensure.step(4);
+        }
+    }    
+}

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ComponentTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ComponentTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ComponentTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ComponentTest.java Tue Sep 30 20:30:21 2014
@@ -4,11 +4,11 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Map;
 
+import junit.framework.Assert;
+
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 
-import junit.framework.Assert;
-
 public class ComponentTest extends TestBase {
     private final Ensure m_ensure = new Ensure();
 

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithAutoConfigTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithAutoConfigTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithAutoConfigTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithAutoConfigTest.java Tue Sep 30 20:30:21 2014
@@ -18,11 +18,11 @@
  */
 package org.apache.felix.dm.itest;
 
+import junit.framework.Assert;
+
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 
-import junit.framework.Assert;
-
 
 public class FELIX2344_ExtraDependencyWithAutoConfigTest extends TestBase {
     /**

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithCallbackTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithCallbackTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithCallbackTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2344_ExtraDependencyWithCallbackTest.java Tue Sep 30 20:30:21 2014
@@ -18,11 +18,11 @@
  */
 package org.apache.felix.dm.itest;
 
+import junit.framework.Assert;
+
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 
-import junit.framework.Assert;
-
 /**
  * Tests for extra dependencies which are declared from service's init method.
  */

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2369_ExtraDependencyTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2369_ExtraDependencyTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2369_ExtraDependencyTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX2369_ExtraDependencyTest.java Tue Sep 30 20:30:21 2014
@@ -18,15 +18,12 @@
  */
 package org.apache.felix.dm.itest;
 
-import java.util.Arrays;
-import java.util.List;
+import junit.framework.Assert;
 
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.ServiceDependency;
 
-import junit.framework.Assert;
-
 /**
  * This testcase verify that a Service is not started if one of its extra required dependencies
  * is unavailable.

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX4361_ConcurrentComponentListingTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX4361_ConcurrentComponentListingTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX4361_ConcurrentComponentListingTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/FELIX4361_ConcurrentComponentListingTest.java Tue Sep 30 20:30:21 2014
@@ -27,10 +27,10 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.felix.dm.DependencyManager;
-
 import junit.framework.Assert;
 
+import org.apache.felix.dm.DependencyManager;
+
 
 /**
  * Test for FELIX-4361 The DependencyManager.getComponents method failed in a concurrent situation on iterating the

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/InstanceBoundDependencyTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/InstanceBoundDependencyTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/InstanceBoundDependencyTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/InstanceBoundDependencyTest.java Tue Sep 30 20:30:21 2014
@@ -18,21 +18,17 @@
  */
 package org.apache.felix.dm.itest;
 
-import java.util.ArrayList;
-import java.util.Dictionary;
 import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
+import junit.framework.Assert;
+
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 
-import junit.framework.Assert;
-
 /**
  * This test does some injection tests on components being in INSTANTIATED_AND_WAITING_FOR_REQUIRED state.
  */

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/MultipleExtraDependenciesTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/MultipleExtraDependenciesTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/MultipleExtraDependenciesTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/MultipleExtraDependenciesTest.java Tue Sep 30 20:30:21 2014
@@ -18,9 +18,7 @@
  */
 package org.apache.felix.dm.itest;
 
-import java.util.ArrayList;
 import java.util.Hashtable;
-import java.util.List;
 
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.Dependency;

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceDependencyInjectionTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceDependencyInjectionTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceDependencyInjectionTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceDependencyInjectionTest.java Tue Sep 30 20:30:21 2014
@@ -18,11 +18,11 @@
  */
 package org.apache.felix.dm.itest;
 
+import junit.framework.Assert;
+
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 
-import junit.framework.Assert;
-
 public class ServiceDependencyInjectionTest extends TestBase {
     public void testServiceInjection() {
         DependencyManager m = getDM();

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceRaceTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceRaceTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceRaceTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceRaceTest.java Tue Sep 30 20:30:21 2014
@@ -13,7 +13,6 @@ import junit.framework.Assert;
 
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.ConfigurationDependency;
-import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.ServiceDependency;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceTrackerTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceTrackerTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceTrackerTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/ServiceTrackerTest.java Tue Sep 30 20:30:21 2014
@@ -25,7 +25,6 @@ import junit.framework.Assert;
 import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.tracker.ServiceTracker;
 import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 
 public class ServiceTrackerTest extends TestBase {

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/TemporalServiceDependencyTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/TemporalServiceDependencyTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/TemporalServiceDependencyTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.itest/src/org/apache/felix/dm/itest/TemporalServiceDependencyTest.java Tue Sep 30 20:30:21 2014
@@ -2,12 +2,12 @@ package org.apache.felix.dm.itest;
 
 import java.util.Hashtable;
 
+import junit.framework.Assert;
+
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.ServiceDependency;
 
-import junit.framework.Assert;
-
 public class TemporalServiceDependencyTest extends TestBase {
     public void testServiceConsumptionAndIntermittentAvailability() {
         final DependencyManager m = getDM();

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AdapterAnnotationParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AdapterAnnotationParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AdapterAnnotationParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AdapterAnnotationParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class AdapterAnnotationParallelTest extends AdapterAnnotationTest {
+    public AdapterAnnotationParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleAnnotationParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleAnnotationParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleAnnotationParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleAnnotationParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class AspectLifecycleAnnotationParallelTest extends AspectLifecycleAnnotationTest {
+    public AspectLifecycleAnnotationParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParalleTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParalleTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParalleTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParalleTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class AspectLifecycleWithDynamicProxyAnnotationParalleTest extends AspectLifecycleWithDynamicProxyAnnotationTest{
+    public AspectLifecycleWithDynamicProxyAnnotationParalleTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class AspectLifecycleWithDynamicProxyAnnotationParallelTest extends AspectLifecycleWithDynamicProxyAnnotationTest {
+    public AspectLifecycleWithDynamicProxyAnnotationParallelTest() {
+        setParallel();
+    }
+}

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/AspectLifecycleWithDynamicProxyAnnotationTest.java Tue Sep 30 20:30:21 2014
@@ -28,8 +28,7 @@ import org.osgi.framework.ServiceRegistr
  * Use case: Tests an aspect service implemented as a dynamic proxy, and ensure that its lifecycle methods are properly invoked 
  * (init/start/stop/destroy methods).
  */
-public class AspectLifecycleWithDynamicProxyAnnotationTest extends TestBase {
-    
+public class AspectLifecycleWithDynamicProxyAnnotationTest extends TestBase {    
     public void testAnnotatedAspect() {
         Ensure e = new Ensure();
         // Provide the Sequencer server to the ServiceProvider service

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/BundleDependencyAnnotationParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/BundleDependencyAnnotationParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/BundleDependencyAnnotationParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/BundleDependencyAnnotationParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class BundleDependencyAnnotationParallelTest extends BundleDependencyAnnotationTest {
+    public BundleDependencyAnnotationParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/CompositeAnnotationsParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/CompositeAnnotationsParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/CompositeAnnotationsParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/CompositeAnnotationsParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class CompositeAnnotationsParallelTest extends CompositeAnnotationsTest {
+    public CompositeAnnotationsParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ExtraServicePropertiesParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ExtraServicePropertiesParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ExtraServicePropertiesParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ExtraServicePropertiesParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class ExtraServicePropertiesParallelTest extends ExtraServicePropertiesTest {
+    public ExtraServicePropertiesParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/FactoryConfigurationAdapterAnnotationParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/FactoryConfigurationAdapterAnnotationParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/FactoryConfigurationAdapterAnnotationParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/FactoryConfigurationAdapterAnnotationParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class FactoryConfigurationAdapterAnnotationParallelTest extends FactoryConfigurationAdapterAnnotationTest {
+    public FactoryConfigurationAdapterAnnotationParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/Felix4357ParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/Felix4357ParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/Felix4357ParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/Felix4357ParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class Felix4357ParallelTest extends Felix4357Test {
+    public Felix4357ParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/MultipleAnnotationsParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/MultipleAnnotationsParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/MultipleAnnotationsParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/MultipleAnnotationsParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class MultipleAnnotationsParallelTest extends MultipleAnnotationsTest {
+    public MultipleAnnotationsParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PropagateAnnotationParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PropagateAnnotationParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PropagateAnnotationParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PropagateAnnotationParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class PropagateAnnotationParallelTest extends PropagateAnnotationTest {
+    public PropagateAnnotationParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PublisherAnnotationParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PublisherAnnotationParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PublisherAnnotationParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/PublisherAnnotationParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class PublisherAnnotationParallelTest extends PublisherAnnotationTest {
+    public PublisherAnnotationParallelTest() {
+        setParallel();
+    }
+}

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ResourceAnnotationTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ResourceAnnotationTest.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ResourceAnnotationTest.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/ResourceAnnotationTest.java Tue Sep 30 20:30:21 2014
@@ -25,6 +25,7 @@ import org.osgi.framework.ServiceRegistr
 
 /**
  * Use case: Verify Bundle Dependency annotations usage.
+ * TODO: this test seems to fail when running with a threadpool.
  */
 public class ResourceAnnotationTest extends TestBase {
     

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/SimpleAnnotationsParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/SimpleAnnotationsParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/SimpleAnnotationsParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/SimpleAnnotationsParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class SimpleAnnotationsParallelTest extends SimpleAnnotationsTest {
+    public SimpleAnnotationsParallelTest() {
+        setParallel();
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/TemporalAnnotationsParallelTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/TemporalAnnotationsParallelTest.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/TemporalAnnotationsParallelTest.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime.itest/src/org/apache/felix/dm/runtime/itest/tests/TemporalAnnotationsParallelTest.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,7 @@
+package org.apache.felix.dm.runtime.itest.tests;
+
+public class TemporalAnnotationsParallelTest extends TemporalAnnotationsTest {
+    public TemporalAnnotationsParallelTest() {
+        setParallel();
+    }
+}

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java Tue Sep 30 20:30:21 2014
@@ -18,7 +18,10 @@
  */
 package org.apache.felix.dm.runtime;
 
+import java.util.Collection;
 import java.util.Dictionary;
+import java.util.Map;
+import java.util.Set;
 
 import org.apache.felix.dm.ComponentDependencyDeclaration;
 import org.apache.felix.dm.Dependency;
@@ -64,6 +67,17 @@ public class ToggleServiceDependency imp
         @Override
         public void close() {
         }
+
+        @Override
+        public Object getEvent() {
+            return null;
+        }
+
+        @Override
+        public Dictionary getProperties()
+        {
+            return null;
+        }
     }
 
     public ToggleServiceDependency() {
@@ -179,10 +193,14 @@ public class ToggleServiceDependency imp
     }
 
     @Override
-    public Object getAutoConfigInstance() {
+    public Event getService() {
         return null;
     }
-
+    
+    @Override
+    public void copyToCollection(Collection to) {
+    }
+    
     @Override
     public boolean isAutoConfig() {
         return false;
@@ -228,4 +246,15 @@ public class ToggleServiceDependency imp
                 : ComponentDependencyDeclaration.STATE_OPTIONAL;
         }
     }
+
+    @Override
+    public boolean isStarted()
+    {
+        return m_isStarted;
+    }
+
+    @Override
+    public void copyToMap(Map<Object, Dictionary> map)
+    {        
+    }
 }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/bnd.bnd Tue Sep 30 20:30:21 2014
@@ -29,6 +29,5 @@ Private-Package: \
 	org.apache.felix.log.maxSize=100000
 -plugin: org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin;log=debug;\
 	path:=${workspace}/org.apache.felix.dependencymanager.annotation/generated/org.apache.felix.dependencymanager.annotation.jar
-Bundle-Activator: org.apache.felix.dependencymanager.samples.tpool.Activator
 -sub:  \
 	*.bnd
\ No newline at end of file

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/device.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/device.bnd?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/device.bnd (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/device.bnd Tue Sep 30 20:30:21 2014
@@ -1,4 +1,3 @@
-Bundle-Activator: org.apache.felix.dependencymanager.samples.device.impl.Activator
+Bundle-Activator: org.apache.felix.dependencymanager.samples.device.Activator
 Private-Package:  \
-	org.apache.felix.dependencymanager.samples.device,\
-	org.apache.felix.dependencymanager.samples.device.impl
\ No newline at end of file
+	org.apache.felix.dependencymanager.samples.device
\ No newline at end of file

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.annot.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.annot.bnd?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.annot.bnd (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/hello.annot.bnd Tue Sep 30 20:30:21 2014
@@ -0,0 +1,2 @@
+Private-Package:  \
+	org.apache.felix.dependencymanager.samples.hello.annot
\ No newline at end of file

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/hello.annot.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/hello.annot.bnd?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/hello.annot.bnd (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/hello.annot.bnd Tue Sep 30 20:30:21 2014
@@ -0,0 +1,2 @@
+Private-Package:  \
+	org.apache.felix.dependencymanager.samples.hello.annot
\ No newline at end of file

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/conf/Configurator.java Tue Sep 30 20:30:21 2014
@@ -15,14 +15,23 @@ import org.osgi.service.cm.Configuration
 public class Configurator {
     private volatile ConfigurationAdmin m_ca;
     volatile Configuration m_serviceConsumerConf;
+    volatile Configuration m_serviceConsumerAnnotConf;
 
     public void start() {
         try {
             System.out.println(Thread.currentThread().getName() + ": Starting " + this.getClass().getName());
+            // Provide configuration to the hello.ServiceConsumer component
             m_serviceConsumerConf = m_ca.getConfiguration("org.apache.felix.dependencymanager.samples.hello.ServiceConsumer", null);
             Hashtable props = new Properties();
             props.put("key", "value");
             m_serviceConsumerConf.update(props);
+            
+            // Provide configuration to the hello.annot.ServiceConsumer component
+            m_serviceConsumerAnnotConf = m_ca.getConfiguration("org.apache.felix.dependencymanager.samples.hello.annot.ServiceConsumer", null);
+            props = new Properties();
+            props.put("key", "value");
+            m_serviceConsumerAnnotConf.update(props);
+
         }
         catch (IOException e) {
             e.printStackTrace();
@@ -31,5 +40,6 @@ public class Configurator {
     
     public void destroy() throws IOException {
     	m_serviceConsumerConf.delete();
+        m_serviceConsumerAnnotConf.delete();
     }
 }

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/Activator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/Activator.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/Activator.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/Activator.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,42 @@
+package org.apache.felix.dependencymanager.samples.device;
+
+import java.util.Hashtable;
+
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+
+/**
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class Activator extends DependencyActivatorBase {
+    @Override
+    public void init(BundleContext context, DependencyManager dm) throws Exception { 
+        createDeviceAndParameter(dm, 1);
+        createDeviceAndParameter(dm, 2);
+
+        dm.add(createAdapterService(Device.class, null)
+            .setImplementation(DeviceAccessImpl.class)
+            .setInterface(DeviceAccess.class.getName(), null));
+        
+        dm.add(createComponent()
+            .setImplementation(DeviceAccessConsumer.class)
+            .add(createServiceDependency()
+                .setService(DeviceAccess.class)
+                .setRequired(true)
+                .setCallbacks("add", null)));
+    }
+    
+    private void createDeviceAndParameter(DependencyManager dm, int id) {
+        Hashtable<String, Object> props = new Hashtable<>();
+        props.put("device.id", id);
+        dm.add(createComponent()
+            .setImplementation(new DeviceImpl(id)).setInterface(Device.class.getName(), props));
+           
+        props = new Hashtable<>();
+        props.put("device.id", id);
+        dm.add(createComponent()
+            .setImplementation(new DeviceParameterImpl(id)).setInterface(DeviceParameter.class.getName(), props));        
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessConsumer.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessConsumer.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessConsumer.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessConsumer.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,12 @@
+package org.apache.felix.dependencymanager.samples.device;
+
+import java.util.Map;
+
+public class DeviceAccessConsumer {
+    void add(Map<String, Object> props, DeviceAccess deviceAccess) {
+        System.out.println("Handling device access: id=" + props.get("device.id") 
+            + "\n\t device=" + deviceAccess.getDevice() 
+            + "\n\t device parameter=" + deviceAccess.getDeviceParameter()
+            + "\n\t device access properties=" + props);
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessImpl.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessImpl.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceAccessImpl.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,34 @@
+package org.apache.felix.dependencymanager.samples.device;
+
+import java.util.Hashtable;
+
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.DependencyManager;
+
+public class DeviceAccessImpl implements DeviceAccess {
+    volatile Device device;
+    volatile DeviceParameter deviceParameter;
+
+    void init(Component c) {
+        // Dynamically add an extra dependency on a DeviceParameter.
+        DependencyManager dm = c.getDependencyManager();
+        c.add(dm.createServiceDependency()
+            .setService(DeviceParameter.class, "(device.id=" + device.getDeviceId() + ")")
+            .setRequired(true));
+        
+        // Dynamically add a service property, using the device.id
+        Hashtable<String, Object> props = new Hashtable<>();
+        props.put("device.access.id", device.getDeviceId());
+        c.setServiceProperties(props);
+    }
+
+    @Override
+    public Device getDevice() {
+        return device;
+    }
+
+    @Override
+    public DeviceParameter getDeviceParameter() {
+        return deviceParameter;    
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceImpl.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceImpl.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceImpl.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,15 @@
+package org.apache.felix.dependencymanager.samples.device;
+
+
+public class DeviceImpl implements Device {
+    final int id;
+    
+    DeviceImpl(int id) {
+        this.id = id;
+    }
+    
+    @Override
+    public int getDeviceId() {
+        return id;
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceParameterImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceParameterImpl.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceParameterImpl.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/device/DeviceParameterImpl.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,15 @@
+package org.apache.felix.dependencymanager.samples.device;
+
+
+public class DeviceParameterImpl implements DeviceParameter {
+    final int id;
+    
+    DeviceParameterImpl(int id) {
+        this.id = id;
+    }
+
+    @Override
+    public int getDeviceId() {
+        return id;
+    }
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceConsumer.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceConsumer.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceConsumer.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceConsumer.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,30 @@
+package org.apache.felix.dependencymanager.samples.hello.annot;
+
+import java.util.Dictionary;
+
+import org.apache.felix.dm.annotation.api.Component;
+import org.apache.felix.dm.annotation.api.ConfigurationDependency;
+import org.apache.felix.dm.annotation.api.ServiceDependency;
+import org.apache.felix.dm.annotation.api.Start;
+
+/**
+ * Our service consumer. We depend on a ServiceProvider, and on a configuration.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@Component
+public class ServiceConsumer {
+    @ServiceDependency
+	volatile ServiceProvider service;
+	
+    @ConfigurationDependency
+    protected void update(Dictionary<?, ?> conf) {
+        System.out.println("ServiceConsumer updated with conf " + conf);
+    }
+    
+    @Start
+	public void start() {
+        System.out.println(Thread.currentThread().getName() + ": Starting " + this.getClass().getName());
+		this.service.hello();
+	}
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProvider.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProvider.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProvider.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,10 @@
+package org.apache.felix.dependencymanager.samples.hello.annot;
+
+/**
+ * The interface for our service provider.
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public interface ServiceProvider {
+	public void hello();
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProviderImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProviderImpl.java?rev=1628547&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProviderImpl.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/hello/annot/ServiceProviderImpl.java Tue Sep 30 20:30:21 2014
@@ -0,0 +1,17 @@
+package org.apache.felix.dependencymanager.samples.hello.annot;
+
+import org.apache.felix.dm.annotation.api.Component;
+
+
+/**
+ * The implementation for our service provider.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@Component
+public class ServiceProviderImpl implements ServiceProvider {
+	@Override
+	public void hello() {
+        System.out.println(Thread.currentThread().getName() + ": Hello");
+	}
+}

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/.classpath
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/.classpath?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/.classpath (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/.classpath Tue Sep 30 20:30:21 2014
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="test"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="src" output="bin" path="src"/>
+	<classpathentry kind="src" output="bin_test" path="test"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
 	<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java Tue Sep 30 20:30:21 2014
@@ -19,6 +19,7 @@
 package org.apache.felix.dm.context;
 
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.Executor;
 
 import org.apache.felix.dm.Component;
@@ -40,4 +41,5 @@ public interface ComponentContext {
     public String getAutoConfigInstance(Class<?> clazz);
     public boolean getAutoConfig(Class<?> clazz);
     public Event getDependencyEvent(DependencyContext dc);
+    public Set<Event> getDependencyEvents(DependencyContext dc);
 }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java Tue Sep 30 20:30:21 2014
@@ -18,7 +18,9 @@
  */
 package org.apache.felix.dm.context;
 
+import java.util.Collection;
 import java.util.Dictionary;
+import java.util.Map;
 
 
 public interface DependencyContext {
@@ -37,6 +39,7 @@ public interface DependencyContext {
 	/** Invoked by the component when the dependency should stop working. */
 	public void stop();
 	
+	public boolean isStarted();
 	public boolean isAvailable();
 	public void setAvailable(boolean available);
 	
@@ -49,7 +52,9 @@ public interface DependencyContext {
 	public boolean needsInstance();
 	
     public Class getAutoConfigType();
-    public Object getAutoConfigInstance();
+    public Event getService();
+    public void copyToCollection(Collection<Object> coll);
+    public void copyToMap(Map<Object, Dictionary> map);
     public boolean isAutoConfig();
     public String getAutoConfigName();
     public DependencyContext createCopy();

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/Event.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/Event.java?rev=1628547&r1=1628546&r2=1628547&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/Event.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/Event.java Tue Sep 30 20:30:21 2014
@@ -18,6 +18,8 @@
  */
 package org.apache.felix.dm.context;
 
+import java.util.Dictionary;
+
 
 /** 
  * An event holds all data that belongs to some external event as it comes in via
@@ -25,6 +27,16 @@ package org.apache.felix.dm.context;
  */
 public interface Event extends Comparable {
     /**
+     * Returns the actual event object wrapped by this event (a Service Dependency, a Bundle for Bundle Dependency, etc...).
+     */
+    Object getEvent();
+    
+    /**
+     * Returns the properties of the actual event object wrapped by this event (Service Dependency properties, ...).
+     */
+    Dictionary getProperties();
+    
+    /**
      * Release the resources this event is holding (like service reference for example).
      */
     public void close();



Mime
View raw message