diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java
index 9cecf0d..70e61d7 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -222,7 +222,19 @@
         // updated method
         String upd = confs[0].getAttribute("updated");
         if (upd != null) {
-            m_updated = new Callback(upd, new Class[] {Dictionary.class}, false, getInstanceManager());
+        	MethodMetadata method = getPojoMetadata().getMethod(upd);
+        	if (method == null) {
+        		throw new ConfigurationException("The updated method is not found in the class "
+        				+ getInstanceManager().getClassName());
+        	} else if (method.getMethodArguments().length == 0) {
+        		m_updated = new Callback(upd, new Class[0], false, getInstanceManager());
+        	} else if (method.getMethodArguments().length == 1
+        			&& method.getMethodArguments()[0].equals(Dictionary.class.getName())) {
+        		m_updated = new Callback(upd, new Class[] {Dictionary.class}, false, getInstanceManager());
+        	} else {
+        		throw new ConfigurationException("The updated method is found in the class "
+        				+ getInstanceManager().getClassName() + " must have either no argument or a Dictionary");
+        	}
         }
 
         for (int i = 0; configurables != null && i < configurables.length; i++) {
@@ -295,14 +307,14 @@
             props.put(Constants.SERVICE_PID, m_managedServicePID);
             props.put("instance.name", getInstanceManager().getInstanceName());
             props.put("factory.name", getInstanceManager().getFactory().getFactoryName());
-            
+
             // Security Check
-            if (SecurityHelper.hasPermissionToRegisterService(ManagedService.class.getName(), 
+            if (SecurityHelper.hasPermissionToRegisterService(ManagedService.class.getName(),
                     getInstanceManager().getContext())) {
                 m_sr = getInstanceManager().getContext().registerService(ManagedService.class.getName(), this, props);
             } else {
-                error("Cannot register the ManagedService - The bundle " 
-                        + getInstanceManager().getContext().getBundle().getBundleId() 
+                error("Cannot register the ManagedService - The bundle "
+                        + getInstanceManager().getContext().getBundle().getBundleId()
                         + " does not have the permission to register the service");
             }
         }
@@ -375,7 +387,7 @@
                 }
             }
             if (!found) {
-                // The property is not a configurable property, aadd it to the toPropagate list.
+                // The property is not a configurable property, add it to the toPropagate list.
                 toPropagate.put(name, value);
             }
         }
@@ -463,6 +475,24 @@
         if (m_updated == null) {
             return;
         }
+
+        if (m_updated.getArguments().length == 0) {
+        	// We don't have to compute the properties,
+        	// we just call the callback.
+        	try {
+                if (instance == null) {
+                    m_updated.call(new Object[0]);
+                } else {
+                    m_updated.call(instance, new Object[0]);
+                }
+            } catch (Exception e) {
+                error("Cannot call the updated method " + m_updated.getMethod() + " : " + e.getMessage());
+            }
+            return;
+        }
+
+        // Else we must compute the properties.
+
         Properties props = new Properties();
         for (int i = 0; i < m_configurableProperties.size(); i++) {
             String n = ((Property) m_configurableProperties.get(i)).getName();
@@ -546,6 +576,6 @@
     public HandlerDescription getDescription() {
         return m_description;
     }
-    
+
 
 }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Callback.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Callback.java
index 6b83eea..fe32379 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Callback.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/util/Callback.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -79,6 +79,8 @@
         m_manager = manager;
         if (args != null) {
             computeArguments(args);
+        } else {
+        	m_args = new String[0];
         }
     }
 
@@ -143,7 +145,7 @@
                             break;
                         }
                     }
-                    if (argIndex == m_args.length) { // No mismatch detected. 
+                    if (argIndex == m_args.length) { // No mismatch detected.
                         return methods[i]; // It is the looked method.
                     }
                 }
@@ -170,7 +172,7 @@
         if (m_methodObj == null) {
             throw new NoSuchMethodException(m_method);
         } else {
-            if (! m_methodObj.isAccessible()) { 
+            if (! m_methodObj.isAccessible()) {
                 // If not accessible, try to set the accessibility.
                 m_methodObj.setAccessible(true);
             }
@@ -209,7 +211,7 @@
      * Invokes the method on every created objects with the specified
      * arguments.
      * @param arg the method arguments
-     * @return the result of the invocation, <code>null</code> for 
+     * @return the result of the invocation, <code>null</code> for
      * <code>void</code> method, the last result for instance containing
      * several objects.
      * @throws NoSuchMethodException if the callback method is not found
@@ -244,7 +246,7 @@
      * arguments.
      * @param instance the instance on which call the method
      * @param arg the argument array
-     * @return the result of the invocation, <code>null</code> for 
+     * @return the result of the invocation, <code>null</code> for
      * <code>void</code> method
      * @throws NoSuchMethodException if the callback method is not found
      * @throws IllegalAccessException if the callback method cannot be called
@@ -265,4 +267,12 @@
     public String getMethod() {
         return m_method;
     }
+
+    /**
+     * Gets the method arguments.
+     * @return the arguments.
+     */
+    public String[] getArguments() {
+    	return m_args;
+    }
 }
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index cec3387..03ccbfc 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -25,18 +25,18 @@
 import org.osgi.framework.BundleContext;
 
 public class FooProviderType1 implements FooService {
-	
+
 	private int m_bar;
 	private String m_foo;
-    
+
     private BundleContext m_context;
-    
+
     private static FooProviderType1 singleton;
     private static int count = 0;
-    
+
     private int updated;
     private Dictionary lastupdated;
-    
+
     private static FooProviderType1 singleton(BundleContext bc) {
         if (singleton == null) {
             count++;
@@ -44,12 +44,12 @@
         }
         return singleton;
     }
-    
+
     public static FooProviderType1 several(BundleContext bc) {
         count++;
         return new FooProviderType1(bc);
     }
-        
+
     public FooProviderType1(BundleContext bc) {
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
@@ -68,41 +68,41 @@
             p.put("foo", m_foo);
         }
         p.put("context", m_context);
-        
+
         p.put("count", new Integer(count));
-        
+
         p.put("updated", new Integer(updated));
         if (lastupdated != null) {
             p.put("lastupdated", lastupdated);
         }
-        
-        
+
+
 		return p;
 	}
-    
+
 	public void testException() throws Exception {
         String a = "foobarbaz";
 	    throw new Exception("foo"+a);
     }
-    
+
     public void testTry() {
             String a = "foo";
             a.charAt(0);
     }
-    
+
     public void testTry2(String s) {
             String a = "foo";
             a.charAt(0);
     }
-    
+
     private void nexttry(String  s) {
         try {
             s += "foo";
         } catch(RuntimeException e) {
-            
+
         }
     }
-    
+
 	public boolean getBoolean() { return true; }
 
 	public double getDouble() { return 1.0; }
@@ -112,7 +112,7 @@
 	public long getLong() { return 1; }
 
 	public Boolean getObject() { return new Boolean(true); }
-	
+
 	/**
 	 * Custom constructor.
 	 * @param bar
@@ -124,7 +124,7 @@
 	    m_foo = foo;
 	    m_context = bc;
 	}
-	
+
 	public void updated(Dictionary props) {
         updated++;
         lastupdated = props;
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java
new file mode 100644
index 0000000..62db9c2
--- /dev/null
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java
@@ -0,0 +1,114 @@
+/*
+ * 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.configuration.service.FooService;
+import org.osgi.framework.BundleContext;
+
+public class FooProviderType2 implements FooService {
+
+	private int m_bar;
+	private String m_foo;
+
+    private BundleContext m_context;
+
+    private static int count = 0;
+
+    private int updated;
+
+
+    public FooProviderType2(BundleContext bc) {
+        if (bc ==null) {
+            throw new RuntimeException("Injected bundle context null");
+        }
+            m_context = bc;
+    }
+
+	public boolean foo() {
+		return true;
+	}
+
+	public Properties fooProps() {
+		Properties p = new Properties();
+		p.put("bar", new Integer(m_bar));
+        if(m_foo != null) {
+            p.put("foo", m_foo);
+        }
+        p.put("context", m_context);
+
+        p.put("count", new Integer(count));
+
+        p.put("updated", new Integer(updated));
+
+
+		return p;
+	}
+
+	public void testException() throws Exception {
+        String a = "foobarbaz";
+	    throw new Exception("foo"+a);
+    }
+
+    public void testTry() {
+            String a = "foo";
+            a.charAt(0);
+    }
+
+    public void testTry2(String s) {
+            String a = "foo";
+            a.charAt(0);
+    }
+
+    private void nexttry(String  s) {
+        try {
+            s += "foo";
+        } catch(RuntimeException e) {
+
+        }
+    }
+
+	public boolean getBoolean() { return true; }
+
+	public double getDouble() { return 1.0; }
+
+	public int getInt() { return 1; }
+
+	public long getLong() { return 1; }
+
+	public Boolean getObject() { return new Boolean(true); }
+
+	/**
+	 * Custom constructor.
+	 * @param bar
+	 * @param foo
+	 * @param bc
+	 */
+	public FooProviderType2(int bar, String foo, BundleContext bc) {
+	    m_bar = bar;
+	    m_foo = foo;
+	    m_context = bc;
+	}
+
+	public void updated() {
+        updated++;
+    }
+
+}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
index 7dc82e4..8bff9b3 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -39,6 +39,8 @@
         ots.addTestSuite(UpdatedMethod.class);
         ots.addTestSuite(UpdatedMethodAndManagedServiceFactory.class);
         ots.addTestSuite(UpdatedMethodAndManagedService.class);
+        ots.addTestSuite(UpdatedNoArgMethodAndManagedService.class);
+        ots.addTestSuite(UpdatedNoArgMethodAndManagedServiceFactory.class);
         ots.addTestSuite(ArchitectureTest.class);
         return ots;
     }
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedService.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedService.java
new file mode 100644
index 0000000..c44236b
--- /dev/null
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedService.java
@@ -0,0 +1,307 @@
+/*
+ * 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.configuration;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+
+public class UpdatedNoArgMethodAndManagedService extends OSGiTestCase {
+
+	/**
+	 * Instance where the ManagedServicePID is provided by the component type.
+	 */
+	ComponentInstance instance1;
+	/**
+     * Instance where the ManagedServicePID is provided by the instance.
+     */
+	ComponentInstance instance2;
+
+	/**
+     * Instance without configuration.
+     */
+    ComponentInstance instance3;
+
+	public void setUp() {
+	    String type = "CONFIG-FooProviderType-4Updated2";
+        Properties p = new Properties();
+        p.put("instance.name","instance");
+        p.put("foo", "foo");
+        p.put("bar", "2");
+        p.put("baz", "baz");
+        instance1 = Utils.getComponentInstance(getContext(), type, p);
+        assertEquals("instance1 created", ComponentInstance.VALID,instance1.getState());
+
+		type = "CONFIG-FooProviderType-3Updated2";
+		Properties p1 = new Properties();
+		p1.put("instance.name","instance-2");
+		p1.put("foo", "foo");
+		p1.put("bar", "2");
+		p1.put("baz", "baz");
+		p1.put("managed.service.pid", "instance");
+		instance2 = Utils.getComponentInstance(getContext(), type, p1);
+
+		type = "CONFIG-FooProviderType-3Updated2";
+        Properties p2 = new Properties();
+        p2.put("instance.name","instance-3");
+        p2.put("managed.service.pid", "instance-3");
+        instance3 = Utils.getComponentInstance(getContext(), type, p2);
+	}
+
+	public void tearDown() {
+		instance1.dispose();
+		instance2.dispose();
+		instance3.dispose();
+		instance1 = null;
+		instance2 = null;
+		instance3 = null;
+	}
+
+	public void testStaticInstance1() {
+		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
+		assertNotNull("Check FS availability", fooRef);
+		String fooP = (String) fooRef.getProperty("foo");
+		Integer barP = (Integer) fooRef.getProperty("bar");
+		String bazP = (String) fooRef.getProperty("baz");
+		assertEquals("Check foo equality -1", fooP, "foo");
+		assertEquals("Check bar equality -1", barP, new Integer(2));
+		assertEquals("Check baz equality -1", bazP, "baz");
+
+		ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
+		assertNotNull("Check ManagedServiceFactory availability", msRef);
+
+		// Configuration of baz
+		Properties conf = new Properties();
+		conf.put("baz", "zab");
+		conf.put("bar", new Integer(2));
+		conf.put("foo", "foo");
+		ManagedService ms = (ManagedService) getContext().getService(msRef);
+		try {
+			ms.updated(conf);
+		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+		// Re-check props
+		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
+		fooP = (String) fooRef.getProperty("foo");
+		barP = (Integer) fooRef.getProperty("bar");
+		bazP = (String) fooRef.getProperty("baz");
+		assertEquals("Check foo equality -2", fooP, "foo");
+		assertEquals("Check bar equality -2", barP, new Integer(2));
+		assertEquals("Check baz equality -2", bazP, "zab");
+
+		// Get Service
+		FooService fs = (FooService) context.getService(fooRef);
+		Integer updated = (Integer) fs.fooProps().get("updated");
+        assertEquals("Check updated", 1, updated.intValue());
+
+        context.ungetService(fooRef);
+		getContext().ungetService(msRef);
+	}
+
+	public void testStaticInstance2() {
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check FS availability", fooRef);
+        String fooP = (String) fooRef.getProperty("foo");
+        Integer barP = (Integer) fooRef.getProperty("bar");
+        String bazP = (String) fooRef.getProperty("baz");
+        assertEquals("Check foo equality -1", fooP, "foo");
+        assertEquals("Check bar equality -1", barP, new Integer(2));
+        assertEquals("Check baz equality -1", bazP, "baz");
+
+        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
+        assertNotNull("Check ManagedService availability", msRef);
+
+
+        // Configuration of baz
+        Properties conf = new Properties();
+        conf.put("baz", "zab");
+        conf.put("bar", new Integer(2));
+        conf.put("foo", "foo");
+        ManagedService ms = (ManagedService) getContext().getService(msRef);
+        try {
+            ms.updated(conf);
+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+        // Recheck props
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
+        fooP = (String) fooRef.getProperty("foo");
+        barP = (Integer) fooRef.getProperty("bar");
+        bazP = (String) fooRef.getProperty("baz");
+        assertEquals("Check foo equality -2", fooP, "foo");
+        assertEquals("Check bar equality -2", barP, new Integer(2));
+        assertEquals("Check baz equality -2", bazP, "zab");
+
+        // Get Service
+        FooService fs = (FooService) context.getService(fooRef);
+        Integer updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated", 1, updated.intValue());
+
+        conf.put("baz", "zab2");
+        conf.put("foo", "oof2");
+        conf.put("bar", new Integer(0));
+        ms = (ManagedService) getContext().getService(msRef);
+        try {
+            ms.updated(conf);
+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+        updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated -2", 2, updated.intValue());
+
+        getContext().ungetService(fooRef);
+        getContext().ungetService(msRef);
+    }
+
+	public void testDynamicInstance1() {
+    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
+    	assertNotNull("Check FS availability", fooRef);
+
+    	String fooP = (String) fooRef.getProperty("foo");
+    	Integer barP = (Integer) fooRef.getProperty("bar");
+    	String bazP = (String) fooRef.getProperty("baz");
+
+    	assertEquals("Check foo equality", fooP, "foo");
+    	assertEquals("Check bar equality", barP, new Integer(2));
+    	assertEquals("Check baz equality", bazP, "baz");
+
+    	ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
+    	assertNotNull("Check ManagedServiceFactory availability", msRef);
+
+    	// Configuration of baz
+    	Properties conf = new Properties();
+    	conf.put("baz", "zab");
+    	conf.put("foo", "oof");
+    	conf.put("bar", new Integer(0));
+    	ManagedService ms = (ManagedService) getContext().getService(msRef);
+    	try {
+    		ms.updated(conf);
+    	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+    	// Re-check props
+    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
+    	fooP = (String) fooRef.getProperty("foo");
+    	barP = (Integer) fooRef.getProperty("bar");
+    	bazP = (String) fooRef.getProperty("baz");
+
+    	assertEquals("Check foo equality", fooP, "oof");
+    	assertEquals("Check bar equality", barP, new Integer(0));
+    	assertEquals("Check baz equality", bazP, "zab");
+
+    	// Check field value
+    	FooService fs = (FooService) getContext().getService(fooRef);
+    	Properties p = fs.fooProps();
+    	fooP = (String) p.get("foo");
+    	barP = (Integer) p.get("bar");
+
+    	assertEquals("Check foo field equality", fooP, "oof");
+    	assertEquals("Check bar field equality", barP, new Integer(0));
+
+        Integer updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated -1", 1, updated.intValue());
+
+        conf.put("baz", "zab2");
+        conf.put("foo", "oof2");
+        conf.put("bar", new Integer(0));
+        ms = (ManagedService) getContext().getService(msRef);
+        try {
+            ms.updated(conf);
+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+        updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated -2", 2, updated.intValue());
+
+
+    	getContext().ungetService(fooRef);
+    	getContext().ungetService(msRef);
+
+    }
+
+	public void testDynamicInstance2() {
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check FS availability", fooRef);
+
+        String fooP = (String) fooRef.getProperty("foo");
+        Integer barP = (Integer) fooRef.getProperty("bar");
+        String bazP = (String) fooRef.getProperty("baz");
+
+        assertEquals("Check foo equality", fooP, "foo");
+        assertEquals("Check bar equality", barP, new Integer(2));
+        assertEquals("Check baz equality", bazP, "baz");
+
+        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
+        assertNotNull("Check ManagedServiceFactory availability", msRef);
+
+        // Configuration of baz
+        Properties conf = new Properties();
+        conf.put("baz", "zab");
+        conf.put("foo", "oof");
+        conf.put("bar", new Integer(0));
+        ManagedService ms = (ManagedService) getContext().getService(msRef);
+        try {
+            ms.updated(conf);
+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+        // Recheck props
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
+        fooP = (String) fooRef.getProperty("foo");
+        barP = (Integer) fooRef.getProperty("bar");
+        bazP = (String) fooRef.getProperty("baz");
+
+        assertEquals("Check foo equality", fooP, "oof");
+        assertEquals("Check bar equality", barP, new Integer(0));
+        assertEquals("Check baz equality", bazP, "zab");
+
+        // Check field value
+        FooService fs = (FooService) getContext().getService(fooRef);
+        Properties p = fs.fooProps();
+        fooP = (String) p.get("foo");
+        barP = (Integer) p.get("bar");
+
+        assertEquals("Check foo field equality", fooP, "oof");
+        assertEquals("Check bar field equality", barP, new Integer(0));
+
+        Integer updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated", 1, updated.intValue());
+
+        conf.put("baz", "zab2");
+        conf.put("foo", "oof2");
+        conf.put("bar", new Integer(0));
+        ms = (ManagedService) getContext().getService(msRef);
+        try {
+            ms.updated(conf);
+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+        updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated -2", 2, updated.intValue());
+
+        getContext().ungetService(fooRef);
+        getContext().ungetService(msRef);
+    }
+}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedServiceFactory.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedServiceFactory.java
new file mode 100644
index 0000000..5067b93
--- /dev/null
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedServiceFactory.java
@@ -0,0 +1,300 @@
+/*
+ * 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.configuration;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedServiceFactory;
+
+public class UpdatedNoArgMethodAndManagedServiceFactory extends OSGiTestCase {
+
+	ComponentInstance instance, instance2;
+
+	public void setUp() {
+		String type = "CONFIG-FooProviderType-3Updated2";
+
+		Properties p1 = new Properties();
+		p1.put("instance.name","instance");
+		p1.put("foo", "foo");
+		p1.put("bar", "2");
+		p1.put("baz", "baz");
+		instance = Utils.getComponentInstance(getContext(), type, p1);
+
+		Properties p2 = new Properties();
+        p2.put("instance.name","instance2");
+
+        instance2 = Utils.getComponentInstance(getContext(), type, p2);
+	}
+
+	public void tearDown() {
+		instance.dispose();
+		instance2.dispose();
+		instance2 = null;
+		instance = null;
+	}
+
+	public void testStatic() {
+
+		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
+		assertNotNull("Check FS availability", fooRef);
+		String fooP = (String) fooRef.getProperty("foo");
+		Integer barP = (Integer) fooRef.getProperty("bar");
+		String bazP = (String) fooRef.getProperty("baz");
+		assertEquals("Check foo equality -1", fooP, "foo");
+		assertEquals("Check bar equality -1", barP, new Integer(2));
+		assertEquals("Check baz equality -1", bazP, "baz");
+
+		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+		assertNotNull("Check ManagedServiceFactory availability", msRef);
+
+
+		// Configuration of baz
+		Properties conf = new Properties();
+		conf.put("baz", "zab");
+		conf.put("bar", new Integer(2));
+		conf.put("foo", "foo");
+		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
+		try {
+			ms.updated(instance.getInstanceName(), conf);
+		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+		// Recheck props
+		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
+		fooP = (String) fooRef.getProperty("foo");
+		barP = (Integer) fooRef.getProperty("bar");
+		bazP = (String) fooRef.getProperty("baz");
+		assertEquals("Check foo equality -2", fooP, "foo");
+		assertEquals("Check bar equality -2", barP, new Integer(2));
+		assertEquals("Check baz equality -2", bazP, "zab");
+
+		 // Get Service
+        FooService fs = (FooService) context.getService(fooRef);
+        Integer updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated", 1, updated.intValue());
+
+		getContext().ungetService(msRef);
+
+	}
+
+	public void testStaticNoValue() {
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check FS availability", fooRef);
+        Object fooP = fooRef.getProperty("foo");
+        Object barP = fooRef.getProperty("bar");
+        Object bazP = fooRef.getProperty("baz");
+        assertEquals("Check foo equality -1", fooP, null);
+        assertEquals("Check bar equality -1", barP, null);
+        assertEquals("Check baz equality -1", bazP, null);
+
+        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
+        assertNotNull("Check ManagedServiceFactory availability", msRef);
+
+
+        // Configuration of baz
+        Properties conf = new Properties();
+        conf.put("baz", "zab");
+        conf.put("bar", new Integer(2));
+        conf.put("foo", "foo");
+        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
+        try {
+            ms.updated(instance2.getInstanceName(), conf);
+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+        // Recheck props
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
+        fooP = (String) fooRef.getProperty("foo");
+        barP = (Integer) fooRef.getProperty("bar");
+        bazP = (String) fooRef.getProperty("baz");
+        assertEquals("Check foo equality -2", fooP, "foo");
+        assertEquals("Check bar equality -2", barP, new Integer(2));
+        assertEquals("Check baz equality -2", bazP, "zab");
+
+        // Get Service
+        FooService fs = (FooService) context.getService(fooRef);
+        Integer updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated", 1, updated.intValue());
+
+        getContext().ungetService(msRef);
+    }
+
+	public void testDynamic() {
+    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
+    	assertNotNull("Check FS availability", fooRef);
+
+    	String fooP = (String) fooRef.getProperty("foo");
+    	Integer barP = (Integer) fooRef.getProperty("bar");
+    	String bazP = (String) fooRef.getProperty("baz");
+
+    	assertEquals("Check foo equality", fooP, "foo");
+    	assertEquals("Check bar equality", barP, new Integer(2));
+    	assertEquals("Check baz equality", bazP, "baz");
+
+    	ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+    	assertNotNull("Check ManagedServiceFactory availability", msRef);
+
+    	// Configuration of baz
+    	Properties conf = new Properties();
+    	conf.put("baz", "zab");
+    	conf.put("foo", "oof");
+    	conf.put("bar", new Integer(0));
+    	ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
+    	try {
+    		ms.updated(instance.getInstanceName(), conf);
+    	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+    	// Recheck props
+    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
+    	fooP = (String) fooRef.getProperty("foo");
+    	barP = (Integer) fooRef.getProperty("bar");
+    	bazP = (String) fooRef.getProperty("baz");
+
+    	assertEquals("Check foo equality", fooP, "oof");
+    	assertEquals("Check bar equality", barP, new Integer(0));
+    	assertEquals("Check baz equality", bazP, "zab");
+
+    	// Check field value
+    	FooService fs = (FooService) getContext().getService(fooRef);
+    	Properties p = fs.fooProps();
+    	fooP = (String) p.get("foo");
+    	barP = (Integer) p.get("bar");
+
+    	assertEquals("Check foo field equality", fooP, "oof");
+    	assertEquals("Check bar field equality", barP, new Integer(0));
+
+        Integer updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated", 1, updated.intValue());
+
+    	getContext().ungetService(fooRef);
+    	getContext().ungetService(msRef);
+    }
+
+	public void testDynamicNoValue() {
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check FS availability", fooRef);
+
+        Object fooP = fooRef.getProperty("foo");
+        Object barP = fooRef.getProperty("bar");
+        Object bazP = fooRef.getProperty("baz");
+        assertEquals("Check foo equality -1", fooP, null);
+        assertEquals("Check bar equality -1", barP, null);
+        assertEquals("Check baz equality -1", bazP, null);
+
+        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
+        assertNotNull("Check ManagedServiceFactory availability", msRef);
+
+        // Configuration of baz
+        Properties conf = new Properties();
+        conf.put("baz", "zab");
+        conf.put("foo", "oof");
+        conf.put("bar", new Integer(0));
+        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
+        try {
+            ms.updated(instance2.getInstanceName(), conf);
+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+        // Recheck props
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
+        fooP = (String) fooRef.getProperty("foo");
+        barP = (Integer) fooRef.getProperty("bar");
+        bazP = (String) fooRef.getProperty("baz");
+
+        assertEquals("Check foo equality", fooP, "oof");
+        assertEquals("Check bar equality", barP, new Integer(0));
+        assertEquals("Check baz equality", bazP, "zab");
+
+        // Check field value
+        FooService fs = (FooService) getContext().getService(fooRef);
+        Properties p = fs.fooProps();
+        fooP = (String) p.get("foo");
+        barP = (Integer) p.get("bar");
+
+        assertEquals("Check foo field equality", fooP, "oof");
+        assertEquals("Check bar field equality", barP, new Integer(0));
+
+        Integer updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated", 1, updated.intValue());
+
+        getContext().ungetService(fooRef);
+        getContext().ungetService(msRef);
+    }
+
+
+    public void testDynamicString() {
+		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
+		assertNotNull("Check FS availability", fooRef);
+
+		String fooP = (String) fooRef.getProperty("foo");
+		Integer barP = (Integer) fooRef.getProperty("bar");
+		String bazP = (String) fooRef.getProperty("baz");
+
+		assertEquals("Check foo equality", fooP, "foo");
+		assertEquals("Check bar equality", barP, new Integer(2));
+		assertEquals("Check baz equality", bazP, "baz");
+
+		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+		assertNotNull("Check ManagedServiceFactory availability", msRef);
+
+		// Configuration of baz
+		Properties conf = new Properties();
+		conf.put("baz", "zab");
+		conf.put("foo", "oof");
+		conf.put("bar", "0");
+		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
+		try {
+			ms.updated(instance.getInstanceName(), conf);
+		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
+
+		// Recheck props
+		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
+		fooP = (String) fooRef.getProperty("foo");
+		barP = (Integer) fooRef.getProperty("bar");
+		bazP = (String) fooRef.getProperty("baz");
+
+		assertEquals("Check foo equality", fooP, "oof");
+		assertEquals("Check bar equality", barP, new Integer(0));
+		assertEquals("Check baz equality", bazP, "zab");
+
+		// Check field value
+		FooService fs = (FooService) getContext().getService(fooRef);
+		Properties p = fs.fooProps();
+		fooP = (String) p.get("foo");
+		barP = (Integer) p.get("bar");
+
+		assertEquals("Check foo field equality", fooP, "oof");
+		assertEquals("Check bar field equality", barP, new Integer(0));
+
+		Integer updated = (Integer) fs.fooProps().get("updated");
+
+        assertEquals("Check updated", 1, updated.intValue());
+
+		getContext().ungetService(fooRef);
+		getContext().ungetService(msRef);
+	}
+
+}
diff --git a/ipojo/tests/core/configuration/src/main/resources/metadata.xml b/ipojo/tests/core/configuration/src/main/resources/metadata.xml
index e41d58a..ede1eff 100644
--- a/ipojo/tests/core/configuration/src/main/resources/metadata.xml
+++ b/ipojo/tests/core/configuration/src/main/resources/metadata.xml
@@ -289,6 +289,19 @@
 			<property name="bar" field="m_bar" />
 		</properties>
 	</component>
+	<component
+		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType2"
+		name="CONFIG-FooProviderType-4Updated2" architecture="true">
+		<provides>
+			<property name="foo" field="m_foo" />
+			<property name="bar" field="m_bar" />
+			<property name="baz" type="java.lang.String" />
+		</provides>
+		<properties propagation="true" pid="FooProvider-3" updated="updated">
+			<property name="foo" field="m_foo" />
+			<property name="bar" field="m_bar" />
+		</properties>
+	</component>
 
 	<component
 		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
@@ -303,5 +316,18 @@
 			<property name="bar" field="m_bar" />
 		</properties>
 	</component>
+	<component
+		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType2"
+		name="CONFIG-FooProviderType-3Updated2" architecture="true">
+		<provides>
+			<property name="foo" field="m_foo" />
+			<property name="bar" field="m_bar" />
+			<property name="baz" type="java.lang.String" />
+		</provides>
+		<properties propagation="true" updated="updated">
+			<property name="foo" field="m_foo" />
+			<property name="bar" field="m_bar" />
+		</properties>
+	</component>
 
 </ipojo>
