diff --git a/ipojo/tests/pom.xml b/ipojo/tests/pom.xml
index 2503642..bc4f2dd 100644
--- a/ipojo/tests/pom.xml
+++ b/ipojo/tests/pom.xml
@@ -41,6 +41,7 @@
 	<module>tests.composite.service.instance</module>
 	<module>tests.composite.service.providing</module>
 	<module>tests.temporal.dependency</module>
+	<module>tests.whiteboard.pattern.handler</module>
    </modules>
    
    <profiles>
diff --git a/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java
index efd79d6..ebb550b 100644
--- a/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java
+++ b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java
@@ -46,9 +46,11 @@
 		if(configuration.get("csh.simple") != null) { props.put("Simple", configuration.get("csh.simple")); }
 		if(configuration.get("csh.map") != null) { 
 			Dictionary m = (Dictionary) configuration.get("csh.map");
-			props.put("Map1", m.get("a"));
-			props.put("Map2", m.get("b"));
-			props.put("Map3", m.get("c"));
+            if (m.size() > 0) {
+                props.put("Map1", m.get("a"));
+                props.put("Map2", m.get("b"));
+                props.put("Map3", m.get("c"));
+            }
 		}
 		props.put("changes", new Integer(changes));
 		
diff --git a/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
index 16f4ed3..c028efb 100644
--- a/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
+++ b/ipojo/tests/tests.core.external.handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
@@ -98,6 +98,28 @@
 		context.ungetService(sr);
 	}
 	
+
+    public void testConfiguration3() {
+        // Check the availability of CheckService
+        String name = "HandlerTest-2-empty";
+        ServiceReference sr = null;
+        ServiceReference[] refs = null;
+        String filter = "("+"instance.name"+"="+name+")";
+        try {
+            refs = context.getServiceReferences(CheckService.class.getName(), filter);
+        } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
+        if(refs != null) { sr = refs[0]; }
+        assertNotNull("Check the check service availability", sr);
+        
+        CheckService cs = (CheckService) context.getService(sr);
+        Properties p = cs.getProps();
+        assertEquals("Assert 'simple' equality", p.get("Simple"), "Simple");
+        assertEquals("Size of p", 3, p.size()); // instance name, simple and changes.
+        
+        cs = null;
+        context.ungetService(sr);
+    }
+	
 	public void testLifecycle() {
 		// Check the availability of CheckService
 	    String name = "HandlerTest-1";
diff --git a/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml b/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml
index 134c5a7..576125f 100644
--- a/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml
@@ -20,5 +20,11 @@
 			<property name="c" value="c" />
 		</property>
 	</instance>
+	<instance name="HandlerTest-2-empty" component="HANDLER-HandlerTester">
+		<property name="csh.simple" value="Simple" />
+		<property name="csh.map">
+		<!-- Empty dictionary -->
+		</property>
+	</instance>
 	
 </ipojo>
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
index 32ddbb0..b654826 100644
--- a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
@@ -31,11 +31,17 @@
     private FooService fs;
 
     public boolean check() {
-        return fs.foo();
+        if (fs != null) {
+            return fs.foo();
+        }
+        return false;
     }
 
     public Properties getProps() {
-        return fs.fooProps();
+        if (fs != null) {
+            return fs.fooProps();
+        }
+        return null;
     }
 
 }
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java
index 5563b9a..a5b4540 100644
--- a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java
@@ -32,7 +32,8 @@
 
     public boolean check() {
         boolean result = true;
-        for (int i = 0; i < fs.length; i++) {
+      
+        for (int i = 0; fs != null && i < fs.length; i++) {
             result = result && fs[i].foo();
         }
         return result;
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullableFooProvider.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullableFooProvider.java
new file mode 100644
index 0000000..821c8c8
--- /dev/null
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullableFooProvider.java
@@ -0,0 +1,55 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
+
+public class NullableFooProvider implements FooService {
+
+    public boolean foo() {
+       return false;
+    }
+
+    public Properties fooProps() {
+        return null;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return -1;
+    }
+
+    public int getInt() {
+        return -1;
+    }
+
+    public long getLong() {
+        return -1;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+}
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java
new file mode 100644
index 0000000..60be3fa
--- /dev/null
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java
@@ -0,0 +1,229 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.test.scenarios.temporal;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class DefaultImplementationTest extends OSGiTestCase {
+    
+   public void testDefaultImplementation() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DICheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider, 2000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       
+       assertTrue("Assert delay", (end - begin) >= 2000);
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 3", cs.check());
+       
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+   }
+   
+   public void testDefaultImplementationTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DICheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       boolean res = false;
+       try {
+           res = cs.check();
+       } catch(RuntimeException e) {
+           fail("A nullable was expected ...");
+       }   
+       assertFalse("Check nullable", res);
+
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+       return;
+   }
+   
+   public void testDelayTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DICheckServiceProviderTimeout", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider, 2000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       
+       assertTrue("Assert delay", (end - begin) >= 2000);
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 3", cs.check());
+       
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+   }
+   
+   public void testDefaultImplementationMultipleTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DIMultipleCheckServiceProviderTimeout", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       DelayedProvider dp = new DelayedProvider(provider, 5000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       boolean res = false;
+       try {
+           res = cs.check();
+       } catch(RuntimeException e) {
+           fail("A nullable was expected ...");
+       }   
+       assertTrue("Check nullable", res);
+       
+       dp.stop();
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+       return;
+   }
+   
+   public void testDelayOnMultipleDependency() {
+       String prov = "provider";
+       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String prov2 = "provider2";
+       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the providers.
+       provider1.stop();
+       provider2.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider1, 2500);
+       DelayedProvider dp2 = new DelayedProvider(provider2, 1000);
+       dp.start();
+       dp2.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       assertTrue("Assert delay", (end - begin) >= 1000  && (end - begin) <= 2500);
+       dp.stop();
+       dp2.stop();
+       
+       provider1.stop();
+       provider2.stop();
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       
+       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained DI will return false to the foo method.
+
+       provider1.dispose();
+       provider2.dispose();
+       under.stop();
+       under.dispose();
+   }
+}
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayTest.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayTest.java
index ea163bd..e2c5940 100644
--- a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayTest.java
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayTest.java
@@ -185,7 +185,7 @@
        String prov2 = "provider2";
        ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
        String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProvider", un);
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-MultipleCheckServiceProvider", un);
        
        ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
        assertNotNull("Check foo availability", ref_fs);
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/EmptyArrayTest.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/EmptyArrayTest.java
new file mode 100644
index 0000000..ba47cc6
--- /dev/null
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/EmptyArrayTest.java
@@ -0,0 +1,116 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.test.scenarios.temporal;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class EmptyArrayTest extends OSGiTestCase {
+   
+   public void testEmptyArrayTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-EmptyMultipleCheckServiceProviderTimeout", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       DelayedProvider dp = new DelayedProvider(provider, 5000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       boolean res = false;
+       try {
+           res = cs.check();
+       } catch(RuntimeException e) {
+           fail("An empty array was expected ...");
+       }   
+       assertTrue("Check empty array", res);
+       
+       dp.stop();
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+       return;
+   }
+   
+   public void testDelayOnMultipleDependency() {
+       String prov = "provider";
+       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String prov2 = "provider2";
+       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-EmptyMultipleCheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the providers.
+       provider1.stop();
+       provider2.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider1, 2500);
+       DelayedProvider dp2 = new DelayedProvider(provider2, 1000);
+       dp.start();
+       dp2.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       assertTrue("Assert delay", (end - begin) >= 1000  && (end - begin) <= 2500);
+       dp.stop();
+       dp2.stop();
+       
+       provider1.stop();
+       provider2.stop();
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       
+       assertTrue("Check invocation - 3", cs.check()); 
+       
+       provider1.dispose();
+       provider2.dispose();
+       under.stop();
+       under.dispose();
+   }
+}
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java
new file mode 100644
index 0000000..246a7c3
--- /dev/null
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java
@@ -0,0 +1,229 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.test.scenarios.temporal;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class NullTest extends OSGiTestCase {
+    
+   public void testNullable() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullCheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider, 2000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       
+       assertTrue("Assert delay", (end - begin) >= 2000);
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 3", cs.check());
+       
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+   }
+   
+   public void testNullableTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullCheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       boolean res = false;
+       try {
+           res = cs.check();
+       } catch(RuntimeException e) {
+           fail("A null was expected ...");
+       }   
+       assertFalse("Check null", res); // Return false when the foo service is null.
+
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+       return;
+   }
+   
+   public void testDelayTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullCheckServiceProviderTimeout", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider, 2000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       
+       assertTrue("Assert delay", (end - begin) >= 2000);
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 3", cs.check());
+       
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+   }
+   
+   public void testNullableMultipleTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullMultipleCheckServiceProviderTimeout", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       DelayedProvider dp = new DelayedProvider(provider, 5000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       boolean res = false;
+       try {
+           res = cs.check();
+       } catch(RuntimeException e) {
+           fail("A null was expected ...");
+       }   
+       assertTrue("Check nullable", res);
+       
+       dp.stop();
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+       return;
+   }
+   
+   public void testDelayOnMultipleDependency() {
+       String prov = "provider";
+       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String prov2 = "provider2";
+       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the providers.
+       provider1.stop();
+       provider2.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider1, 2500);
+       DelayedProvider dp2 = new DelayedProvider(provider2, 1000);
+       dp.start();
+       dp2.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       assertTrue("Assert delay", (end - begin) >= 1000  && (end - begin) <= 2500);
+       dp.stop();
+       dp2.stop();
+       
+       provider1.stop();
+       provider2.stop();
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       
+       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained nullable will return false to the foo method.
+
+       provider1.dispose();
+       provider2.dispose();
+       under.stop();
+       under.dispose();
+   }
+}
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java
new file mode 100644
index 0000000..1fad94a
--- /dev/null
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java
@@ -0,0 +1,229 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.test.scenarios.temporal;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class NullableTest extends OSGiTestCase {
+    
+   public void testNullable() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableCheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider, 2000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       
+       assertTrue("Assert delay", (end - begin) >= 2000);
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 3", cs.check());
+       
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+   }
+   
+   public void testNullableTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableCheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       boolean res = false;
+       try {
+           res = cs.check();
+       } catch(RuntimeException e) {
+           fail("A nullable was expected ...");
+       }   
+       assertFalse("Check nullable", res);
+       
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+       return;
+   }
+   
+   public void testDelayTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableCheckServiceProviderTimeout", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider, 2000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       
+       assertTrue("Assert delay", (end - begin) >= 2000);
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 3", cs.check());
+       
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+   }
+   
+   public void testNullableMultipleTimeout() {
+       String prov = "provider";
+       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProviderTimeout", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the provider.
+       provider.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       DelayedProvider dp = new DelayedProvider(provider, 5000);
+       dp.start();
+       cs = (CheckService) context.getService(ref_cs);
+       boolean res = false;
+       try {
+           res = cs.check();
+       } catch(RuntimeException e) {
+           fail("A nullable was expected ...");
+       }   
+       assertTrue("Check nullable", res);
+       
+       dp.stop();
+       provider.stop();
+       provider.dispose();
+       under.stop();
+       under.dispose();
+       return;
+   }
+   
+   public void testDelayOnMultipleDependency() {
+       String prov = "provider";
+       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
+       String prov2 = "provider2";
+       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
+       String un = "under-1";
+       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProvider", un);
+       
+       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
+       assertNotNull("Check foo availability", ref_fs);
+       
+       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability", ref_cs);
+       
+       CheckService cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation", cs.check());
+       
+       // Stop the providers.
+       provider1.stop();
+       provider2.stop();
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 2", ref_cs);
+       long begin = System.currentTimeMillis();
+       DelayedProvider dp = new DelayedProvider(provider1, 2500);
+       DelayedProvider dp2 = new DelayedProvider(provider2, 1000);
+       dp.start();
+       dp2.start();
+       cs = (CheckService) context.getService(ref_cs);
+       assertTrue("Check invocation - 2", cs.check());
+       long end = System.currentTimeMillis();
+       assertTrue("Assert delay", (end - begin) >= 1000  && (end - begin) <= 2500);
+       dp.stop();
+       dp2.stop();
+       
+       provider1.stop();
+       provider2.stop();
+       
+       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
+       assertNotNull("Check cs availability - 3", ref_cs);
+       cs = (CheckService) context.getService(ref_cs);
+       
+       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained nullable will return false to the foo method.
+
+       provider1.dispose();
+       provider2.dispose();
+       under.stop();
+       under.dispose();
+   }
+}
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java
index 6b6fbd0..7f5d1cd 100644
--- a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java
@@ -30,6 +30,10 @@
         OSGiTestSuite ots = new OSGiTestSuite("Temporal Dependency Test Suite", bc);
         ots.addTestSuite(NoDelayTest.class);
         ots.addTestSuite(DelayTest.class);
+        ots.addTestSuite(NullableTest.class); 
+        ots.addTestSuite(DefaultImplementationTest.class);
+        ots.addTestSuite(NullTest.class);
+        ots.addTestSuite(EmptyArrayTest.class);
         return ots;
     }
 
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/resources/metadata.xml b/ipojo/tests/tests.temporal.dependency/src/main/resources/metadata.xml
index 7a5e936..efff053 100644
--- a/ipojo/tests/tests.temporal.dependency/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.temporal.dependency/src/main/resources/metadata.xml
@@ -17,4 +17,78 @@
 	<component classname="org.apache.felix.ipojo.test.scenarios.component.FooProvider" name="TEMPORAL-FooProvider">
 		<provides/>
 	</component>
+	
+	<!-- Dependencies using nullables -->
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullableMultipleCheckServiceProvider">
+		<temp:requires field="fs" onTimeout="nullable"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullableCheckServiceProvider">
+		<temp:requires field="fs" onTimeout="nullable"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullableCheckServiceProviderTimeout">
+		<temp:requires field="fs" timeout="4000" onTimeout="nullable"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullableMultipleCheckServiceProviderTimeout">
+		<temp:requires field="fs" timeout="4000" onTimeout="nullable"/>
+		<provides/>
+	</component>
+	
+	<!-- Dependencies using default implementation -->
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-DIMultipleCheckServiceProvider">
+		<temp:requires field="fs" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-DICheckServiceProvider">
+		<temp:requires field="fs" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-DICheckServiceProviderTimeout">
+		<temp:requires field="fs" timeout="4000" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-DIMultipleCheckServiceProviderTimeout">
+		<temp:requires field="fs" timeout="4000" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
+		<provides/>
+	</component>
+	
+	<!-- Dependencies using null -->
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullMultipleCheckServiceProvider">
+		<temp:requires field="fs" onTimeout="null"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullCheckServiceProvider">
+		<temp:requires field="fs" onTimeout="null"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullCheckServiceProviderTimeout">
+		<temp:requires field="fs" timeout="4000" onTimeout="null"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullMultipleCheckServiceProviderTimeout">
+		<temp:requires field="fs" timeout="4000" onTimeout="null"/>
+		<provides/>
+	</component>
+	
+		<!-- Dependencies using empty arrays -->
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-EmptyMultipleCheckServiceProvider">
+		<temp:requires field="fs" onTimeout="empty-array"/>
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-EmptyMultipleCheckServiceProviderTimeout">
+		<temp:requires field="fs" timeout="4000" onTimeout="empty-array"/>
+		<provides/>
+	</component>
 </ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/tests.whiteboard.pattern.handler/pom.xml b/ipojo/tests/tests.whiteboard.pattern.handler/pom.xml
new file mode 100644
index 0000000..b38c6a9
--- /dev/null
+++ b/ipojo/tests/tests.whiteboard.pattern.handler/pom.xml
@@ -0,0 +1,61 @@
+<project>
+  <groupId>ipojo.test</groupId>
+  <version>0.9.0-SNAPSHOT</version>
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>bundle</packaging>
+  <name>iPOJO White Board Pattern Handler Test Suite</name>
+  <artifactId>tests.whiteboard.pattern.handler</artifactId>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.ipojo</artifactId>
+      <version>0.9.0-SNAPSHOT</version>
+    </dependency>
+	<dependency>
+		<groupId>org.apache.felix</groupId>
+		<artifactId>org.osgi.core</artifactId>
+		<version>1.0.0</version>
+	</dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+    </dependency>
+	<dependency>
+		<groupId>ipojo.examples</groupId>
+		<artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
+		<version>0.9.0-SNAPSHOT</version>
+	</dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>1.4.0</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Private-Package>org.apache.felix.ipojo.test, org.apache.felix.ipojo.test.scenarios.util</Private-Package>
+            <Test-Suite>org.apache.felix.ipojo.test.WbpTests</Test-Suite>
+          </instructions>
+        </configuration>
+      </plugin>
+      <plugin>
+	      <groupId>org.apache.felix</groupId>
+	      <artifactId>maven-ipojo-plugin</artifactId>
+	      <version>0.9.0-SNAPSHOT</version>
+		  <executions>
+          	<execution>
+            	<goals>
+	              <goal>ipojo-bundle</goal>
+               </goals>
+                <configuration>
+   					<ignoreAnnotations>true</ignoreAnnotations>
+            	</configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/FooProvider.java b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/FooProvider.java
new file mode 100644
index 0000000..5a996cd
--- /dev/null
+++ b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/FooProvider.java
@@ -0,0 +1,15 @@
+package org.apache.felix.ipojo.test;
+
+public class FooProvider implements FooService {
+    
+    public String foo;
+
+    public void foo() { 
+        if (foo.equals("foo")) {
+            foo = "bar";
+        } else {
+            foo = "foo";
+        }
+    }
+    
+}
diff --git a/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/FooService.java b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/FooService.java
new file mode 100644
index 0000000..0040354
--- /dev/null
+++ b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/FooService.java
@@ -0,0 +1,7 @@
+package org.apache.felix.ipojo.test;
+
+public interface FooService {
+    
+    public void foo();
+
+}
diff --git a/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/FooWhiteBoardPattern.java b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/FooWhiteBoardPattern.java
new file mode 100644
index 0000000..787748e
--- /dev/null
+++ b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/FooWhiteBoardPattern.java
@@ -0,0 +1,36 @@
+package org.apache.felix.ipojo.test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.osgi.framework.ServiceReference;
+
+public class FooWhiteBoardPattern implements Observable {
+    
+    List list = new ArrayList();
+    int modifications = 0;
+    
+    public void onArrival(ServiceReference ref) {
+        list.add(ref);
+    }
+    
+    public void onDeparture(ServiceReference ref) {
+        list.remove(ref);
+    }
+    
+    public void onModification(ServiceReference ref) {
+        modifications = modifications + 1;
+    }
+
+    public Map getObservations() {
+        Map map = new HashMap();
+        map.put("list", list);
+        map.put("modifications", new Integer(modifications));
+        return map;
+    }
+    
+    
+
+}
diff --git a/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/Observable.java b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/Observable.java
new file mode 100644
index 0000000..94d7787
--- /dev/null
+++ b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/Observable.java
@@ -0,0 +1,9 @@
+package org.apache.felix.ipojo.test;
+
+import java.util.Map;
+
+public interface Observable {
+    
+    public Map getObservations();
+
+}
diff --git a/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/WbpTests.java b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/WbpTests.java
new file mode 100644
index 0000000..d25c1e1
--- /dev/null
+++ b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/WbpTests.java
@@ -0,0 +1,196 @@
+package org.apache.felix.ipojo.test;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.MissingHandlerException;
+import org.apache.felix.ipojo.UnacceptableConfiguration;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class WbpTests extends OSGiTestCase {
+    
+    Factory provFactory;
+    Factory factory, factory2;
+
+    public void setUp() {
+        provFactory = Utils.getFactoryByName(context, "fooprovider");
+        factory = Utils.getFactoryByName(context, "under-providers");
+        factory2 = Utils.getFactoryByName(context, "under-properties");
+    }
+    
+    public void tearDown() {
+        
+    }
+    
+    public void testServiceProviders() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
+        ComponentInstance ci = factory.createComponentInstance(new Properties());
+        
+        ServiceReference ref = Utils.getServiceReferenceByName(context, Observable.class.getName(), ci.getInstanceName());
+        assertNotNull("Check Observable availability", ref);
+        Observable obs = (Observable) context.getService(ref);
+        
+        Map map = obs.getObservations();
+        assertEquals("Check empty list" , ((List) map.get("list")).size(), 0);
+        
+        Properties p1 = new Properties();
+        p1.put("foo", "foo");
+        ComponentInstance prov1 = provFactory.createComponentInstance(p1);
+        
+        map = obs.getObservations();
+        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
+       
+        Properties p2 = new Properties();
+        p2.put("foo", "foo");
+        ComponentInstance prov2 = provFactory.createComponentInstance(p2);
+        
+        map = obs.getObservations();
+        assertEquals("Check list #2" , ((List) map.get("list")).size(), 2);
+        
+        prov1.stop();
+        
+        map = obs.getObservations();
+        assertEquals("(1) Check list #1" , ((List) map.get("list")).size(), 1);
+        
+        prov2.stop();
+        
+        map = obs.getObservations();
+        assertEquals("(2) Check list #0" , ((List) map.get("list")).size(), 0);
+        
+        prov2.start();
+        
+        map = obs.getObservations();
+        assertEquals("(3) Check list #1" , ((List) map.get("list")).size(), 1);
+        
+        prov1.start();
+        
+        map = obs.getObservations();
+        assertEquals("(4) Check list #2" , ((List) map.get("list")).size(), 2);
+        
+        prov1.dispose();
+        
+        map = obs.getObservations();
+        assertEquals("(5) Check list #1" , ((List) map.get("list")).size(), 1);
+        
+        prov2.dispose();
+        
+        map = obs.getObservations();
+        assertEquals("(6) Check list #0" , ((List) map.get("list")).size(), 0);
+        
+        context.ungetService(ref);
+        ci.dispose();
+    }
+    
+    public void testPropertiesProviders() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
+        ComponentInstance ci = factory2.createComponentInstance(new Properties());
+        
+        ServiceReference ref = Utils.getServiceReferenceByName(context, Observable.class.getName(), ci.getInstanceName());
+        assertNotNull("Check Observable availability", ref);
+        Observable obs = (Observable) context.getService(ref);
+        
+        Map map = obs.getObservations();
+        assertEquals("Check empty list" , ((List) map.get("list")).size(), 0);
+        
+        Properties p1 = new Properties();
+        p1.put("foo", "foo");
+        ComponentInstance prov1 = provFactory.createComponentInstance(p1);
+        ServiceReference ref1 = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov1.getInstanceName());
+        FooService fs1 = (FooService) context.getService(ref1);
+        
+        map = obs.getObservations();
+        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
+       
+        Properties p2 = new Properties();
+        p2.put("foo", "foo");
+        ComponentInstance prov2 = provFactory.createComponentInstance(p2);
+        ServiceReference ref2 = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov2.getInstanceName());
+        FooService fs2 = (FooService) context.getService(ref2);
+        
+        map = obs.getObservations();
+        assertEquals("Check list #2" , ((List) map.get("list")).size(), 2);
+        
+        fs1.foo();
+        
+        map = obs.getObservations();
+        assertEquals("(1) Check list #1" , ((List) map.get("list")).size(), 1);
+        
+        fs2.foo();
+        
+        map = obs.getObservations();
+        assertEquals("(2) Check list #0" , ((List) map.get("list")).size(), 0);
+        
+        fs2.foo();
+        
+        map = obs.getObservations();
+        assertEquals("(3) Check list #1" , ((List) map.get("list")).size(), 1);
+        
+        fs1.foo();
+        
+        map = obs.getObservations();
+        assertEquals("(4) Check list #2" , ((List) map.get("list")).size(), 2);
+        
+        prov1.dispose();
+        
+        map = obs.getObservations();
+        assertEquals("(5) Check list #1" , ((List) map.get("list")).size(), 1);
+        
+        prov2.dispose();
+        
+        map = obs.getObservations();
+        assertEquals("(6) Check list #0" , ((List) map.get("list")).size(), 0);
+        
+        context.ungetService(ref1);
+        context.ungetService(ref2);
+        context.ungetService(ref);
+        ci.dispose();
+    }
+    
+    public void testModifications() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
+        ComponentInstance ci = factory.createComponentInstance(new Properties());
+        
+        ServiceReference ref = Utils.getServiceReferenceByName(context, Observable.class.getName(), ci.getInstanceName());
+        assertNotNull("Check Observable availability", ref);
+        Observable obs = (Observable) context.getService(ref);
+        
+        Map map = obs.getObservations();
+        assertEquals("Check empty list" , ((List) map.get("list")).size(), 0);
+        
+        Properties p1 = new Properties();
+        p1.put("foo", "foo");
+        ComponentInstance prov1 = provFactory.createComponentInstance(p1);
+        
+        map = obs.getObservations();
+        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
+        assertEquals("Check modification #0" , ((Integer) map.get("modifications")).intValue(), 0);
+        
+        ServiceReference ref2 = Utils.getServiceReference(context, FooService.class.getName(), null);
+        assertNotNull("Check FooService availability", ref2);
+        
+        FooService fs = (FooService) context.getService(ref2);
+        fs.foo();
+        
+        map = obs.getObservations();
+        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
+        assertEquals("Check modification #1 (" + map.get("modifications")+")" , ((Integer) map.get("modifications")).intValue(), 1);
+        
+        fs.foo();
+        
+        map = obs.getObservations();
+        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
+        assertEquals("Check modification #2" , ((Integer) map.get("modifications")).intValue(), 2);
+        
+        prov1.dispose();
+        map = obs.getObservations();
+        assertEquals("Check list #0" , ((List) map.get("list")).size(), 0);
+        assertEquals("Check modification #2" , ((Integer) map.get("modifications")).intValue(), 2);
+        
+        context.ungetService(ref);
+        context.ungetService(ref2);
+        ci.dispose();
+    }
+}
diff --git a/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
new file mode 100644
index 0000000..e453bed
--- /dev/null
+++ b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
@@ -0,0 +1,261 @@
+package org.apache.felix.ipojo.test.scenarios.util;
+
+import java.util.Dictionary;
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.Handler;
+import org.apache.felix.ipojo.HandlerFactory;
+import org.apache.felix.ipojo.ServiceContext;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ManagedServiceFactory;
+
+public class Utils {
+
+    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
+        ServiceReference[] refs;
+        try {
+            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
+            if (refs == null) {
+                System.err.println("Cannot get the factory " + factoryName);
+                return null;
+            }
+            return ((Factory) bc.getService(refs[0]));
+        } catch (InvalidSyntaxException e) {
+            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+            return null;
+        }
+    }
+
+    public static HandlerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
+        ServiceReference[] refs;
+        try {
+            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
+            if (refs == null) {
+                System.err.println("Cannot get the factory " + factoryName);
+                return null;
+            }
+            return (HandlerFactory) bc.getService(refs[0]);
+        } catch (InvalidSyntaxException e) {
+            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+            return null;
+        }
+    }
+
+    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
+        Factory fact = getFactoryByName(bc, factoryName);
+
+        if (fact == null) {
+            System.err.println("Factory " + factoryName + " not found");
+            return null;
+        }
+
+        // if(fact.isAcceptable(configuration)) {
+        try {
+            return fact.createComponentInstance(configuration);
+        } catch (Exception e) {
+            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
+            e.printStackTrace();
+            return null;
+        }
+        // }
+        // else {
+        // System.err.println("Configuration not accepted by : " + factoryName);
+        // return null;
+        // }
+    }
+
+    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
+        Factory fact = getFactoryByName(bc, factoryName);
+
+        if (fact == null) {
+            System.err.println("Factory " + factoryName + " not found");
+            return null;
+        }
+
+        try {
+            Properties props = new Properties();
+            props.put("name", name);
+            return fact.createComponentInstance(props);
+        } catch (Exception e) {
+            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
+        ServiceReference[] refs = null;
+        try {
+            refs = bc.getServiceReferences(itf, filter);
+        } catch (InvalidSyntaxException e) {
+            System.err.println("Invalid Filter : " + filter);
+        }
+        if (refs == null) {
+            return new ServiceReference[0];
+        } else {
+            return refs;
+        }
+    }
+
+    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
+        ServiceReference[] refs = null;
+        try {
+            refs = bc.getServiceReferences(itf, filter);
+        } catch (InvalidSyntaxException e) {
+            System.err.println("Invalid Filter : " + filter);
+        }
+        if (refs == null) {
+            return null;
+        } else {
+            return refs[0];
+        }
+    }
+
+    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
+        ServiceReference[] refs = null;
+        String filter = null;
+        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
+            filter = "(" + "factory.name" + "=" + name + ")";
+        } else {
+            filter = "(" + "instance.name" + "=" + name + ")";
+        }
+        try {
+            refs = bc.getServiceReferences(itf, filter);
+        } catch (InvalidSyntaxException e) {
+            System.err.println("Invalid Filter : " + filter);
+        }
+        if (refs == null) {
+            return null;
+        } else {
+            return refs[0];
+        }
+    }
+
+    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
+        ServiceReference ref = getServiceReference(bc, itf, filter);
+        if (ref != null) {
+            return bc.getService(ref);
+        } else {
+            return null;
+        }
+    }
+
+    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
+        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
+        if (refs != null) {
+            Object[] list = new Object[refs.length];
+            for (int i = 0; i < refs.length; i++) {
+                list[i] = bc.getService(refs[i]);
+            }
+            return list;
+        } else {
+            return new Object[0];
+        }
+    }
+
+    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
+        ServiceReference[] refs;
+        try {
+            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
+            if (refs == null) { return null; }
+            return ((Factory) bc.getService(refs[0]));
+        } catch (InvalidSyntaxException e) {
+            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+            return null;
+        }
+    }
+
+    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
+        Factory fact = getFactoryByName(bc, factoryName);
+
+        if (fact == null) { return null; }
+
+        if (fact.isAcceptable(configuration)) {
+            try {
+                return fact.createComponentInstance(configuration);
+            } catch (Exception e) {
+                System.err.println(e.getMessage());
+                e.printStackTrace();
+                return null;
+            }
+        } else {
+            System.err.println("Configuration not accepted by : " + factoryName);
+            return null;
+        }
+    }
+
+    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
+        ServiceReference[] refs = null;
+        try {
+            refs = bc.getServiceReferences(itf, filter);
+        } catch (InvalidSyntaxException e) {
+            System.err.println("Invalid Filter : " + filter);
+        }
+        if (refs == null) {
+            return new ServiceReference[0];
+        } else {
+            return refs;
+        }
+    }
+
+    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
+        ServiceReference[] refs = null;
+        try {
+            refs = bc.getServiceReferences(itf, filter);
+        } catch (InvalidSyntaxException e) {
+            System.err.println("Invalid Filter : " + filter);
+        }
+        if (refs == null) {
+            return null;
+        } else {
+            return refs[0];
+        }
+    }
+
+    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
+        ServiceReference[] refs = null;
+        String filter = null;
+        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
+            filter = "(" + "factory.name" + "=" + name + ")";
+        } else {
+            filter = "(" + "instance.name" + "=" + name + ")";
+        }
+        try {
+            refs = bc.getServiceReferences(itf, filter);
+        } catch (InvalidSyntaxException e) {
+            System.err.println("Invalid Filter : " + filter);
+        }
+        if (refs == null) {
+            return null;
+        } else {
+            return refs[0];
+        }
+    }
+
+    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
+        ServiceReference ref = getServiceReference(bc, itf, filter);
+        if (ref != null) {
+            return bc.getService(ref);
+        } else {
+            return null;
+        }
+    }
+
+    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
+        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
+        if (refs != null) {
+            Object[] list = new Object[refs.length];
+            for (int i = 0; i < refs.length; i++) {
+                list[i] = bc.getService(refs[i]);
+            }
+            return list;
+        } else {
+            return new Object[0];
+        }
+    }
+
+}
diff --git a/ipojo/tests/tests.whiteboard.pattern.handler/src/main/resources/metadata.xml b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/resources/metadata.xml
new file mode 100644
index 0000000..0f1da91
--- /dev/null
+++ b/ipojo/tests/tests.whiteboard.pattern.handler/src/main/resources/metadata.xml
@@ -0,0 +1,17 @@
+<ipojo xmlns:wbp="org.apache.felix.ipojo.white-board-pattern">
+	<component className="org.apache.felix.ipojo.test.FooProvider" name="fooprovider">
+		<provides>
+			<property field="foo" value="foo"/>
+		</provides>
+	</component>
+	
+	<component className="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-providers">
+		<wbp:wbp filter="(objectclass=org.apache.felix.ipojo.test.FooService)" onArrival="onArrival" onDeparture="onDeparture" onModification="onModification"/>
+		<provides/>
+	</component>
+	
+	<component className="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-properties">
+		<wbp:wbp filter="(foo=foo)" onArrival="onArrival" onDeparture="onDeparture" onModification="onModification"/>
+		<provides/>
+	</component>
+</ipojo>
