- Refactor instance descriptions to fit with the new introspection and reconfiguration API (instances will be reconfigurable directly from their instance description).
- Prepare the moving of junit4osgi (leave the example folder)

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@730353 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeInstanceDescription.java b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeInstanceDescription.java
new file mode 100644
index 0000000..ef085be
--- /dev/null
+++ b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeInstanceDescription.java
@@ -0,0 +1,91 @@
+/* 
+ * 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.composite;
+
+import org.apache.felix.ipojo.ServiceContext;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
+import org.apache.felix.ipojo.architecture.InstanceDescription;
+import org.apache.felix.ipojo.metadata.Element;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * Composite Instance Description.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class CompositeInstanceDescription extends InstanceDescription {
+    
+    /**
+     * Creates a Primitive Instance Description.
+     * @param type the component type description
+     * @param instance the instance description
+     */
+    public CompositeInstanceDescription(ComponentTypeDescription type, CompositeManager instance) {
+        super(type, instance);
+    }
+
+
+    /**
+     * Gets the list of contained instance in the describe instance.
+     * This list contains only instances who exposed their architecture.
+     * @return the list of contained instances.
+     */
+    public InstanceDescription[] getContainedInstances() {
+        // Get instances description of internal instance
+        ServiceContext internal = ((CompositeManager) m_instance).getServiceContext();
+        try {
+            ServiceReference[]refs = internal.getServiceReferences(Architecture.class.getName(), null);
+            if (refs != null) {
+                InstanceDescription[] descs = new InstanceDescription[refs.length];
+                for (int i = 0; i < refs.length; i++) {
+                    Architecture arch = (Architecture) internal.getService(refs[i]);
+                    descs[i] = arch.getInstanceDescription();
+                    internal.ungetService(refs[i]);
+                }
+                return descs;
+            }
+        } catch (InvalidSyntaxException e) {
+            // Cannot happen
+        }
+        return new InstanceDescription[0];
+    }
+
+    
+    /**
+     * Gets the instance description.
+     * Overridden to add created objects.
+     * @return the instance description
+     */
+    public Element getDescription() {
+        Element elem = super.getDescription();
+        // Contained instance (exposing architecture) (empty if primitive)
+        InstanceDescription[] descs = getContainedInstances();
+        if (descs.length > 0) {
+            Element inst = new Element("ContainedInstances", "");
+            for (int i = 0; i < descs.length; i++) {
+                inst.addElement(descs[i].getDescription());
+            }
+            elem.addElement(inst);
+        }
+        return elem;
+    }
+
+}
diff --git a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeManager.java b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeManager.java
index 7d5fd84..890855d 100644
--- a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeManager.java
+++ b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeManager.java
@@ -25,17 +25,15 @@
 import org.apache.felix.ipojo.ComponentFactory;

 import org.apache.felix.ipojo.ComponentInstance;

 import org.apache.felix.ipojo.ConfigurationException;

+import org.apache.felix.ipojo.Handler;

 import org.apache.felix.ipojo.HandlerFactory;

 import org.apache.felix.ipojo.HandlerManager;

 import org.apache.felix.ipojo.IPojoContext;

 import org.apache.felix.ipojo.InstanceStateListener;

 import org.apache.felix.ipojo.ServiceContext;

-import org.apache.felix.ipojo.architecture.Architecture;

 import org.apache.felix.ipojo.architecture.InstanceDescription;

 import org.apache.felix.ipojo.metadata.Element;

 import org.osgi.framework.BundleContext;

-import org.osgi.framework.InvalidSyntaxException;

-import org.osgi.framework.ServiceReference;

 

 /**

  * iPOJO Composite manager. The composite manager class manages one instance of

@@ -72,6 +70,11 @@
     private CompositeServiceContext m_internalContext;

     

     /**

+     * The instance description.

+     */

+    private final CompositeInstanceDescription m_description;

+    

+    /**

      * Name of the component instance.

      */

     private String m_name;

@@ -93,6 +96,8 @@
         // Initialize the service context.

         m_internalContext = new CompositeServiceContext(m_context, this);

         m_handlers = handlers;

+        m_description = new CompositeInstanceDescription(m_factory.getComponentDescription(), this);

+

     }

 

     /**

@@ -209,27 +214,7 @@
      * @see org.apache.felix.ipojo.ComponentInstance#getInstanceDescription()

      */

     public InstanceDescription getInstanceDescription() {

-        InstanceDescription desc = new InstanceDescription(m_name, m_state, getContext().getBundle().getBundleId(), m_factory.getComponentDescription());

-        CompositeHandler[] handlers = getRegistredCompositeHandlers();

-        for (int i = 0; i < handlers.length; i++) {

-            desc.addHandler(handlers[i].getDescription());

-        }

-

-        // Get instances description of internal instance

-        ServiceReference[] refs;

-        try {

-            refs = m_internalContext.getServiceReferences(Architecture.class.getName(), null);

-            if (refs != null) {

-                for (int i = 0; i < refs.length; i++) {

-                    Architecture arch = (Architecture) m_internalContext.getService(refs[i]);

-                    desc.addInstance(arch.getInstanceDescription());

-                    m_internalContext.ungetService(refs[i]);

-                }

-            }

-        } catch (InvalidSyntaxException e) {

-            // Cannot happen

-        }

-        return desc;

+        return m_description;

     }

 

     /**

@@ -350,6 +335,12 @@
         m_state = INVALID;

 

         m_internalContext.start(); // Turn on the factory tracking

+        

+        // Plug handler descriptions

+        Handler[] handlers = getRegistredCompositeHandlers();

+        for (int i = 0; i < handlers.length; i++) {

+            m_description.addHandler(handlers[i].getDescription());

+        }

 

         for (int i = 0; i < m_handlers.length; i++) {

             m_handlers[i].start();

diff --git a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java
index 3443073..7f686d9 100644
--- a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java
+++ b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandler.java
@@ -54,6 +54,11 @@
      */

     private Factory[] m_factories;

     

+    /**

+     * Handler description.

+     */

+    private InstanceHandlerDescription m_description;

+    

 

     /**

      * This structure aims to manage a configuration. It stores all necessary

@@ -238,6 +243,8 @@
             }

             m_configurations[i] = new ManagedConfiguration(conf);

         }

+        

+        m_description = new InstanceHandlerDescription(this, m_configurations);

     }

 

     /**

@@ -380,11 +387,7 @@
      * @see org.apache.felix.ipojo.CompositeHandler#getDescription()

      */

     public HandlerDescription getDescription() {

-        List list = new ArrayList();

-        for (int i = 0; i < m_configurations.length; i++) {

-            list.add(m_configurations[i]);

-        }

-        return new InstanceHandlerDescription(this, list);

+        return m_description;

     }

 

     /**

diff --git a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandlerDescription.java b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandlerDescription.java
index 3481ff5..a7fc53e 100644
--- a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandlerDescription.java
+++ b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/instance/InstanceHandlerDescription.java
@@ -18,8 +18,6 @@
  */

 package org.apache.felix.ipojo.composite.instance;

 

-import java.util.List;

-

 import org.apache.felix.ipojo.ComponentInstance;

 import org.apache.felix.ipojo.architecture.HandlerDescription;

 import org.apache.felix.ipojo.composite.CompositeHandler;

@@ -34,10 +32,11 @@
  */

 public class InstanceHandlerDescription extends HandlerDescription {

 

+  

     /**

      * List of managed instances.

      */

-    private List m_instances;

+    private ManagedConfiguration[] m_configurations; 

 

     /**

      * Constructor.

@@ -45,9 +44,9 @@
      * @param handler : handler

      * @param insts : list of component instances

      */

-    public InstanceHandlerDescription(CompositeHandler handler, List insts) {

+    public InstanceHandlerDescription(CompositeHandler handler, ManagedConfiguration[] insts) {

         super(handler);

-        m_instances = insts;

+        m_configurations = insts;

     }

 

     /**

@@ -57,8 +56,8 @@
      */

     public Element getHandlerInfo() {

         Element instances = super.getHandlerInfo();

-        for (int i = 0; i < m_instances.size(); i++) {

-            ManagedConfiguration inst = (ManagedConfiguration) m_instances.get(i);

+        for (int i = 0; i < m_configurations.length; i++) {

+            ManagedConfiguration inst = m_configurations[i];

             Element instance = new Element("Instance", "");

             if (inst.getInstance() == null) { 

                 instance.addAttribute(new Attribute("Factory", inst.getConfiguration().get("component").toString()));

diff --git a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/ServiceDependencyHandler.java b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/ServiceDependencyHandler.java
index c33fda1..4cbf2f1 100644
--- a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/ServiceDependencyHandler.java
+++ b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiator/ServiceDependencyHandler.java
@@ -61,6 +61,11 @@
      * Flag indicating if the handler has already finished the start method.

      */

     private boolean m_isStarted;

+    

+    /**

+     * The handler description.

+     */

+    private ServiceInstantiatorDescription m_description;

 

     /**

      * Source Managers.

@@ -228,10 +233,9 @@
             } else {

                 throw new ConfigurationException("Unknown action : " + action);

             }

-            

-            

-

         }

+        

+        m_description = new ServiceInstantiatorDescription(this, m_instances, m_importers);

     }

 

     /**

@@ -358,7 +362,7 @@
      * @see org.apache.felix.ipojo.CompositeHandler#getDescription()

      */

     public HandlerDescription getDescription() {

-        return new ServiceInstantiatorDescription(this, m_instances, m_importers);

+        return m_description;

     }

     

     public List getInstances() {

diff --git a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java
index 017919e..2c63301 100644
--- a/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java
+++ b/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/service/provides/ProvidedServiceHandler.java
@@ -80,6 +80,11 @@
      * List of component type.

      */

     private List m_types;

+    

+    /**

+     * Handler description.

+     */

+    private ProvidedServiceHandlerDescription m_description;

 

     /**

      * Initialize the component type.

@@ -163,6 +168,8 @@
                 m_exporters.add(imp);

             } // Others case cannot happen. The test was already made during the factory initialization.

         }

+        

+        m_description = new ProvidedServiceHandlerDescription(this, m_services, m_exporters);

 

     }

 

@@ -474,7 +481,7 @@
     }

 

     public HandlerDescription getDescription() {

-        return new ProvidedServiceHandlerDescription(this, m_managedServices, m_exporters);

+        return m_description;

     }

 

     /**

diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
index 892b6ea..56f6d6b 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceManager.java
@@ -77,6 +77,11 @@
      * The instance factory.
      */
     private final ComponentFactory m_factory;
+    
+    /**
+     * The instance description.
+     */
+    private final PrimitiveInstanceDescription m_description;
 
     /**
      * The bundle context of the instance.
@@ -146,6 +151,7 @@
         m_factory = factory;
         m_context = context;
         m_handlers = handlers;
+        m_description = new PrimitiveInstanceDescription(m_factory.getComponentDescription(), this);
     }
 
     /**
@@ -177,25 +183,7 @@
      * @see org.apache.felix.ipojo.ComponentInstance#getInstanceDescription()
      */
     public InstanceDescription getInstanceDescription() {
-        int componentState = getState();
-        InstanceDescription desc =
-                new InstanceDescription(m_name, componentState, getContext().getBundle().getBundleId(), m_factory.getComponentDescription());
-
-        synchronized (this) { // Must be synchronized, it access to the m_pojoObjects list.
-            if (m_pojoObjects != null) {
-                String[] objects = new String[m_pojoObjects.size()];
-                for (int i = 0; i < m_pojoObjects.size(); i++) {
-                    objects[i] = m_pojoObjects.get(i).toString();
-                }
-                desc.setCreatedObjects(objects);
-            }
-        }
-
-        Handler[] handlers = getRegistredHandlers();
-        for (int i = 0; i < handlers.length; i++) {
-            desc.addHandler(handlers[i].getDescription());
-        }
-        return desc;
+        return m_description;
     }
 
     /**
@@ -295,6 +283,12 @@
             }
         }
         
+        // Plug handler descriptions
+        Handler[] handlers = getRegistredHandlers();
+        for (int i = 0; i < handlers.length; i++) {
+            m_description.addHandler(handlers[i].getDescription());
+        }
+        
         for (int i = 0; i < m_handlers.length; i++) {
             m_handlers[i].addInstanceStateListener(this);
             try {
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveInstanceDescription.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveInstanceDescription.java
new file mode 100644
index 0000000..b7d135d
--- /dev/null
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveInstanceDescription.java
@@ -0,0 +1,79 @@
+/* 
+ * 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;
+
+import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
+import org.apache.felix.ipojo.architecture.InstanceDescription;
+import org.apache.felix.ipojo.metadata.Attribute;
+import org.apache.felix.ipojo.metadata.Element;
+
+/**
+ * Primitive Instance Description.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class PrimitiveInstanceDescription extends InstanceDescription {
+    
+    /**
+     * Creates a Primitive Instance Description.
+     * @param type the component type description
+     * @param instance the instance description
+     */
+    public PrimitiveInstanceDescription(ComponentTypeDescription type, InstanceManager instance) {
+        super(type, instance);
+    }
+
+    /**
+     * Gets the list of object created by the described instance.
+     * @return the created objects.
+     */
+    public String[] getCreatedObjects() {
+        // TODO should get a copy
+        Object [] objs = ((InstanceManager) m_instance).getPojoObjects();
+        if (objs != null) {
+            String[] result = new String[objs.length];
+            for (int i = 0; i < objs.length; i++) {
+                result[i] = objs[i].toString();
+            }
+            return result;
+        } else {
+            return new String[0];
+        }
+    }
+    
+    /**
+     * Gets the instance description.
+     * Overridden to add created objects.
+     * @return the instance description
+     */
+    public Element getDescription() {
+        Element elem = super.getDescription();
+        // Created Object (empty is composite)
+        String[] objs = getCreatedObjects();
+        for (int i = 0; i < objs.length; i++) {
+            Element obj = new Element("Object", "");
+            obj.addAttribute(new Attribute("name", ((Object) objs[i]).toString()));
+            elem.addElement(obj);
+        }
+        return elem;
+    }
+    
+    
+
+}
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/Architecture.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/Architecture.java
index 223c51e..db23941 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/Architecture.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/Architecture.java
@@ -28,7 +28,7 @@
 
     /**
      * Returns the description of the instance.
-     * @return the current component instance description
+     * @return the component instance description
      */
     InstanceDescription getInstanceDescription();
 
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/HandlerDescription.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/HandlerDescription.java
index 2cd3a5a..ffc64c8 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/HandlerDescription.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/HandlerDescription.java
@@ -19,6 +19,7 @@
 package org.apache.felix.ipojo.architecture;
 
 import org.apache.felix.ipojo.Handler;
+import org.apache.felix.ipojo.HandlerFactory;
 import org.apache.felix.ipojo.metadata.Attribute;
 import org.apache.felix.ipojo.metadata.Element;
 
@@ -30,49 +31,51 @@
 public class HandlerDescription {
 
     /**
-     * Handler Class Name (i.e namespace).
+     * The Handler Qualified Name.
      */
     private String m_handlerName;
 
-    /**
-     * Is the handler valid.
-     */
-    private boolean m_isValid;
 
     /**
-     * Constructor.
-     * 
-     * @param handler : handler.
+     * The described handler instance.
+     */
+    private Handler m_handler;
+
+    /**
+     * Creates a handler description.
+     * @param handler the handler.
      */
     public HandlerDescription(Handler handler) {
-        m_handlerName = handler.getClass().getName();
-        m_isValid = handler.isValid();
+        HandlerFactory factory = (HandlerFactory) handler.getHandlerManager().getFactory();
+        m_handlerName = factory.getHandlerName();
+        m_handler = handler;
     }
 
     /**
-     * Check if the handler is valid.
+     * Checks if the handler is valid.
      * @return true if the handler is valid.
      */
     public boolean isValid() {
-        return m_isValid;
+        return m_handler.isValid();
     }
 
     /**
-     * Get the handler name.
-     * @return the handler name (i.e. namespace).
+     * Gets the handler name.
+     * @return the handler qualified name (i.e. namespace:name).
      */
     public String getHandlerName() {
         return m_handlerName;
     }
 
     /**
-     * Get handler information.
+     * Gets handler information.
+     * This represent the actual state of the handler.
      * @return the handler information.
      */
     public Element getHandlerInfo() {
         Element elem = new Element("Handler", "");
         elem.addAttribute(new Attribute("name", m_handlerName));
-        if (m_isValid) {
+        if (isValid()) {
             elem.addAttribute(new Attribute("state", "valid"));
         } else {
             elem.addAttribute(new Attribute("state", "invalid"));
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/InstanceDescription.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/InstanceDescription.java
index e7b0c59..347d4c7 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/InstanceDescription.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/architecture/InstanceDescription.java
@@ -19,6 +19,7 @@
 package org.apache.felix.ipojo.architecture;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.InstanceStateListener;
 import org.apache.felix.ipojo.metadata.Attribute;
 import org.apache.felix.ipojo.metadata.Element;
 
@@ -27,87 +28,45 @@
  * 
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-public class InstanceDescription {
-
+public class InstanceDescription implements InstanceStateListener {
+   
     /**
-     * The name of the component (instance).
+     * The list of handlers plugged on the component instance.
      */
-    private String m_name;
-
+    protected HandlerDescription[] m_handlers = new HandlerDescription[0];
+    
     /**
-     * Handlers of the component instance.
+     * The Underlying component instance.
      */
-    private HandlerDescription[] m_handlers = new HandlerDescription[0];
-
-    /**
-     * Created Instances of the components.
-     */
-    private String[] m_createdObjects = new String[0];
-
-    /**
-     * State of the component (VALID / UNRESOLVED).
-     */
-    private int m_state;
-
-    /**
-     * BundleId who create the instance.
-     */
-    private long m_bundleId;
+    protected ComponentInstance m_instance;
 
     /**
      * Component Type of the instance.
      */
-    private ComponentTypeDescription m_type;
+    protected ComponentTypeDescription m_type;
 
     /**
-     * Contained instance list.
+     * Creates the instance description.
+     * @param ci  the state of the instance.
+     * @param desc  the component type description of this instance.
      */
-    private InstanceDescription[] m_containedInstances = new InstanceDescription[0];
-
-    /**
-     * Constructor.
-     * 
-     * @param name : the name of the component instance.
-     * @param state : the state of the instance.
-     * @param bundleId : bundle id owning this instance.
-     * @param desc : the component type description of this instance.
-     */
-    public InstanceDescription(String name, int state, long bundleId, ComponentTypeDescription desc) {
-        m_name = name;
-        m_state = state;
-        m_createdObjects = new String[0];
+    public InstanceDescription(ComponentTypeDescription desc, ComponentInstance ci) {
         m_handlers = new HandlerDescription[0];
-        m_containedInstances = new InstanceDescription[0];
-        m_bundleId = bundleId;
         m_type = desc;
+        m_instance = ci;
+        m_instance.addInstanceStateListener(this);
     }
 
     /**
-     * Get the instance name.
+     * Gets the instance name.
      * @return the name of the instance.
      */
     public String getName() {
-        return m_name;
+        return m_instance.getInstanceName();
     }
 
     /**
-     * Get the list of object created by the described instance.
-     * @return the created instances
-     */
-    public String[] getCreatedObjects() {
-        return m_createdObjects;
-    }
-
-    /**
-     * Set the array of objects created by the described instance.
-     * @param objects : the list of create objects.
-     */
-    public void setCreatedObjects(String[] objects) {
-        m_createdObjects = objects;
-    }
-
-    /**
-     * Get the component type description of the described instance.
+     * Gets the component type description of the described instance.
      * @return : the component type description of this instance.
      */
     public ComponentTypeDescription getComponentDescription() {
@@ -115,7 +74,7 @@
     }
 
     /**
-     * Get the plugged handler list.
+     * Gets the plugged handler list.
      * @return the live handler list
      */
     public HandlerDescription[] getHandlers() {
@@ -123,7 +82,7 @@
     }
 
     /**
-     * Add an handler description to the list.
+     * Adds an handler description to the list.
      * @param desc : the handler description to add
      */
     public void addHandler(HandlerDescription desc) {
@@ -140,82 +99,61 @@
         newHd[m_handlers.length] = desc;
         m_handlers = newHd;
     }
-
+    
     /**
-     * Add an instance description to the contained instance list.
-     * 
-     * @param inst : the handler description to add
+     * Gets a handler description by specifying the handler qualified name.
+     * @param handler the handler name
+     * @return the handler description or <code>null</code> if not found
      */
-    public void addInstance(InstanceDescription inst) {
-        // Verify that the dependency description is not already in the array.
-        for (int i = 0; i < m_containedInstances.length; i++) {
-            if (m_containedInstances[i].getName().equals(inst.getName())) {
-                return; // NOTHING TO DO, the description is already in the array
+    public HandlerDescription getHandlerDescription(String handler) {
+        for (int i = 0; i < m_handlers.length; i++) {
+            if (m_handlers[i].getHandlerName().equals(handler)) {
+                return m_handlers[i];
             }
         }
-        // The component Description is not in the array, add it
-        InstanceDescription[] newCi = new InstanceDescription[m_containedInstances.length + 1];
-        System.arraycopy(m_containedInstances, 0, newCi, 0, m_containedInstances.length);
-        newCi[m_containedInstances.length] = inst;
-        m_containedInstances = newCi;
+        return null;
     }
 
     /**
-     * Set the state of the component.
-     * 
-     * @param state : the state
-     */
-    public void setState(int state) {
-        m_state = state;
-    }
-
-    /**
-     * Get the state of the described instance.
+     * Gets the state of the described instance.
      * @return the state of the instance.
      */
     public int getState() {
-        return m_state;
+        waitForStability();
+        return m_instance.getState();
     }
 
     /**
-     * Get the bundle id of the bundle containing the described instance.
+     * Gets the bundle id of the bundle containing the component type of the instance.
      * @return the bundle id owning the component implementation class.
      */
     public long getBundleId() {
-        return m_bundleId;
+        return m_instance.getFactory().getBundleContext().getBundle().getBundleId();
     }
 
     /**
-     * Get the list of contained instance in the describe instance.
-     * This list contains only instances who exposed their architecture.
-     * @return the list of contained instances.
-     */
-    public InstanceDescription[] getContainedInstances() {
-        return m_containedInstances;
-    }
-
-    /**
-     * Get the instance description.
+     * Gets the instance description.
      * @return the instance description
      */
     public Element getDescription() {
         Element instance = new Element("Instance", "");
         instance.addAttribute(new Attribute("name", getName())); // Name
-        // State
-        if (m_state == ComponentInstance.STOPPED) {
+        
+        int state = getState();
+        if (state == ComponentInstance.STOPPED) {
             instance.addAttribute(new Attribute("state", "stopped"));
         }
-        if (m_state == ComponentInstance.VALID) {
+        if (state == ComponentInstance.VALID) {
             instance.addAttribute(new Attribute("state", "valid"));
         }
-        if (m_state == ComponentInstance.INVALID) {
+        if (state == ComponentInstance.INVALID) {
             instance.addAttribute(new Attribute("state", "invalid"));
         }
-        if (m_state == ComponentInstance.DISPOSED) {
+        if (state == ComponentInstance.DISPOSED) {
             instance.addAttribute(new Attribute("state", "disposed"));
         }
         // Bundle
-        instance.addAttribute(new Attribute("bundle", Long.toString(m_bundleId)));
+        instance.addAttribute(new Attribute("bundle", Long.toString(getBundleId())));
 
         // Component Type
         instance.addAttribute(new Attribute("component.type", m_type.getName()));
@@ -224,22 +162,33 @@
         for (int i = 0; i < m_handlers.length; i++) {
             instance.addElement(m_handlers[i].getHandlerInfo());
         }
-        // Created Object (empty is composite)
-        for (int i = 0; i < m_createdObjects.length; i++) {
-            Element obj = new Element("Object", "");
-            obj.addAttribute(new Attribute("name", ((Object) m_createdObjects[i]).toString()));
-            instance.addElement(obj);
-        }
-        // Contained instance (exposing architecture) (empty if primitive)
-        if (m_containedInstances.length > 0) {
-            Element inst = new Element("ContainedInstances", "");
-            for (int i = 0; i < m_containedInstances.length; i++) {
-                inst.addElement(m_containedInstances[i].getDescription());
-            }
-            instance.addElement(inst);
-        }
+
         return instance;
 
     }
 
+    /**
+     * Waits for state stability before returning results.
+     */
+    private synchronized void waitForStability() {
+        while (m_instance.getState() == -2) { // Transition
+            try {
+                wait();
+            } catch (InterruptedException e) {
+               // We're interrupted, will re-check the condition.
+            }
+        }
+        
+    }
+
+    /**
+     * The underlying instance state changes.
+     * @param instance the instance
+     * @param newState the new state
+     * @see org.apache.felix.ipojo.InstanceStateListener#stateChanged(org.apache.felix.ipojo.ComponentInstance, int)
+     */
+    public synchronized void stateChanged(ComponentInstance instance, int newState) {
+        notifyAll(); // if we was in a transition, the transition is now done.
+    }
+
 }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyDescription.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyDescription.java
index b79f41f..483ae0e 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyDescription.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyDescription.java
@@ -27,134 +27,51 @@
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class DependencyDescription {
-
     /**
-     * Required Service Interface.
+     * The described dependency.
      */
-    private String m_interface;
-    
-    /**
-     * Dependency Id.
-     */
-    private String m_id;
-
-    /**
-     * Is the dependency aggregate?
-     */
-    private boolean m_aggregate;
-
-    /**
-     * Is the dependency optional ?
-     */
-    private boolean m_optional;
-    
-    /**
-     * Binding policy used by this service dependency.
-     */
-    private int m_bindingPolicy;
-    
-    /**
-     * Does the dependency use a nullable object?
-     */
-    private boolean m_useNullable;
-    
-    /**
-     * Does the dependency use a default-implementation? 
-     */
-    private String m_defaultImplementation;
-
-    /**
-     * State (VALID | INVALID).
-     */
-    private int m_state;
-
-    /**
-     * Dependency Filter.
-     */
-    private String m_filter;
-    
-    /**
-     * Is the provider set frozen ?
-     */
-    private boolean m_isFrozen;
-    
-    /**
-     * Comparator used by the dependency.
-     * Null means OSGi default comparator.
-     */
-    private String m_comparator;
-
-    /**
-     * List of used service references.
-     */
-    private List m_usedServices;
-
-    /**
-     * List of matching service references.
-     */
-    private List m_serviceReferences;
+    private Dependency m_dependency;
 
     /**
      * Creates a dependency description.
-     * @param itf the needed interface
-     * @param id the dependency id.
-     * @param multiple is the dependency a multiple dependency ?
-     * @param optional is the dependency optional ?
-     * @param filter the filter
-     * @param policy binding policy
-     * @param nullable does the dependency support nullable object
-     * @param defaultImpl does the dependency use a default implementation
-     * @param comparator does the dependency use a special comparator
-     * @param frozen is the provider set frozen
-     * @param state the state
+     * @param dep the described dependency
      */
-    public DependencyDescription(String itf, String id, boolean multiple, boolean optional, String filter, int policy, boolean nullable, String defaultImpl, String comparator, boolean frozen, int state) {
-        super();
-        m_interface = itf;
-        m_id = id;
-        m_aggregate = multiple;
-        m_optional = optional;
-        m_filter = filter;
-        m_state = state;
-        m_bindingPolicy = policy;
-        m_useNullable = nullable;
-        m_defaultImplementation = defaultImpl;
-        m_comparator = comparator;
-        m_isFrozen = frozen;
+    public DependencyDescription(Dependency dep) {
+        m_dependency = dep;
     }
 
-    public boolean isMultiple() { return m_aggregate; }
+    public boolean isMultiple() { return m_dependency.isAggregate(); }
 
-    public boolean isOptional() { return m_optional; }
+    public boolean isOptional() { return m_dependency.isOptional(); }
 
-    public String getFilter() { return m_filter; }
+    public String getFilter() { return m_dependency.getFilter(); }
 
-    public String getInterface() { return m_interface; }
+    public String getInterface() { return m_dependency.getSpecification().getName(); }
 
-    public int getState() { return m_state; }
+    public int getState() { return m_dependency.getState(); }
     
-    public String getId() { return m_id; }
+    public String getId() { return m_dependency.getId(); }
     
     /**
-     * Gets true if the dependency uses Nullable objects.
+     * Gets <code>true</code> if the dependency uses Nullable objects.
      * @return true if the dependency is optional and supports nullable object.
      */
-    public boolean supportsNullable() { return m_useNullable; }
+    public boolean supportsNullable() { return m_dependency.supportsNullable(); }
     
-    public String getDefaultImplementation() { return m_defaultImplementation; }
+    public String getDefaultImplementation() { return m_dependency.getDefaultImplementation(); }
     
-    public int getPolicy() { return m_bindingPolicy; }
+    public int getPolicy() { return m_dependency.getBindingPolicy(); }
     
-    public String getComparator() { return m_comparator; }
+    public String getComparator() { return m_dependency.getComparator(); }
     
-    public boolean isFrozen() { return m_isFrozen; }
+    public boolean isFrozen() { return m_dependency.isFrozen(); }
 
     /**
      * Gets the service reference list.
      * @return the list of matching service reference,
      * null if no service reference.
      */
-    public List getServiceReferences() { return m_serviceReferences; }
+    public List getServiceReferences() { return m_dependency.getServiceReferencesAsList(); }
 
     /**
      * Gets the service reference if only one service reference is used.
@@ -162,34 +79,19 @@
      * or null if no service reference.
      */
     public ServiceReference getServiceReference() { 
-        if (m_serviceReferences == null) {
+        List list = getServiceReferences();
+        if (list == null) {
             return null;
         } else {
-            return (ServiceReference) m_serviceReferences.get(0);
+            return (ServiceReference) list.get(0);
         }
     }
 
     /**
-     * Sets the service reference array.
-     * @param refs : the list of service reference
-     */
-    public void setServiceReferences(List refs) { m_serviceReferences = refs; }
-
-    /**
      * Gets the used service set.
      * @return the list [service reference] containing the used services,
      * null if no providers are used
      */
-    public List getUsedServices() { return m_usedServices; }
-
-    /**
-     * Sets the usedServices.
-     * @param usages : the list of used service reference.
-     */
-    public void setUsedServices(List usages) {
-        m_usedServices = usages;
-    }
-
-
+    public List getUsedServices() { return m_dependency.getUsedServiceReferences(); }
 
 }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
index 601238a..89ff46d 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
@@ -75,6 +75,11 @@
      * Is the handler started.
      */
     private boolean m_started;
+    
+    /**
+     * The handler description.
+     */
+    private DependencyHandlerDescription m_description;
 
     /**
      * Add a dependency.
@@ -435,6 +440,8 @@
                 }
             }
         }
+        
+        m_description = new DependencyHandlerDescription(this, m_dependencies); // Initialize the description.
     }
 
     /**
@@ -445,6 +452,7 @@
         // Start the dependencies
         for (int i = 0; i < m_dependencies.length; i++) {
             Dependency dep = m_dependencies[i];
+           
             dep.start();
         }
         // Check the state
@@ -481,17 +489,7 @@
      * @see org.apache.felix.ipojo.Handler#getDescription()
      */
     public HandlerDescription getDescription() {
-        DependencyHandlerDescription dhd = new DependencyHandlerDescription(this);
-        for (int j = 0; j < getDependencies().length; j++) {
-            Dependency dep = getDependencies()[j];
-            // Create & add the dependency description
-            DependencyDescription desc =
-                    new DependencyDescription(dep.getSpecification().getName(), dep.getId(), dep.isAggregate(), dep.isOptional(), dep.getFilter(), dep.getBindingPolicy(), dep.supportsNullable(), dep.getDefaultImplementation(), dep.getComparator(), dep.isFrozen(), dep.getState());
-            desc.setServiceReferences(dep.getServiceReferencesAsList());
-            desc.setUsedServices(dep.getUsedServiceReferences());
-            dhd.addDependency(desc);
-        }
-        return dhd;
+        return m_description;
     }
 
 }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandlerDescription.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandlerDescription.java
index 4da77ad..786ec33 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandlerDescription.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandlerDescription.java
@@ -21,7 +21,6 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.felix.ipojo.Handler;
 import org.apache.felix.ipojo.architecture.HandlerDescription;
 import org.apache.felix.ipojo.metadata.Attribute;
 import org.apache.felix.ipojo.metadata.Element;
@@ -42,11 +41,16 @@
     private DependencyDescription[] m_dependencies = new DependencyDescription[0];
 
     /**
-     * Constructor.
-     * @param handler : Handler.
+     * Creates the Dependency Handler description.
+     * @param handler the Dependency Handler.
+     * @param deps the Dependencies
      */
-    public DependencyHandlerDescription(Handler handler) {
+    public DependencyHandlerDescription(DependencyHandler handler, Dependency[] deps) {
         super(handler);
+        m_dependencies = new DependencyDescription[deps.length];
+        for (int i = 0; i < m_dependencies.length; i++) {
+            m_dependencies[i] = new DependencyDescription(deps[i]);
+        }
     }
 
     /**
@@ -58,27 +62,7 @@
     }
 
     /**
-     * Add a dependency.
-     * 
-     * @param dep : the dependency to add
-     */
-    public void addDependency(DependencyDescription dep) {
-        // Verify that the dependency description is not already in the array.
-        for (int i = 0; i < m_dependencies.length; i++) {
-            if (m_dependencies[i] == dep) {
-                return; // NOTHING TO DO, the description is already in the
-                        // array
-            }
-        }
-        // The component Description is not in the array, add it
-        DependencyDescription[] newDep = new DependencyDescription[m_dependencies.length + 1];
-        System.arraycopy(m_dependencies, 0, newDep, 0, m_dependencies.length);
-        newDep[m_dependencies.length] = dep;
-        m_dependencies = newDep;
-    }
-
-    /**
-     * Build Dependency Handler description.
+     * Builds the Dependency Handler description.
      * @return the handler description.
      * @see org.apache.felix.ipojo.architecture.HandlerDescription#getHandlerInfo()
      */
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceDescription.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceDescription.java
index d8fe68a..c1cc148 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceDescription.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceDescription.java
@@ -20,6 +20,7 @@
 
 import java.util.Properties;
 
+import org.apache.felix.ipojo.util.Property;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -32,51 +33,24 @@
     /**
      * State : the service is unregistered.
      */
-    public static final int UNREGISTERED = 0;
+    public static final int UNREGISTERED = ProvidedService.UNREGISTERED;
 
     /**
      * State : the service is registered.
      */
-    public static final int REGISTERED = 1;
-
+    public static final int REGISTERED = ProvidedService.REGISTERED;
+    
     /**
-     * Provided Service Specification.
+     * The describe provided service.
      */
-    private String[] m_serviceSpecification;
-
-    /**
-     * State.
-     */
-    private int m_state;
-
-    /**
-     * The service reference.
-     */
-    private ServiceReference m_serviceReference;
-
-    // /**
-    // * Handler on the component description who contains this description.
-    // */
-    // private InstanceDescription m_parent;
-
-    /**
-     * Properties of the provided service.
-     */
-    private Properties m_properties = new Properties();
+    private ProvidedService m_ps;
 
     /**
      * Constructor.
-     * 
-     * @param serviceSpecification : the provided contract
-     * @param state : state (UNREGITRED | REGISTRED)
-     * @param ref : Service Registration (to obtain the reference), or null if
-     * state is UNREGISTRED
+     * @param ps the described provided service.
      */
-    public ProvidedServiceDescription(String[] serviceSpecification, int state, ServiceReference ref) {
-        m_serviceSpecification = serviceSpecification;
-        m_state = state;
-        m_serviceReference = ref;
-        // m_parent = parent;
+    public ProvidedServiceDescription(ProvidedService ps) {
+        m_ps = ps;
     }
 
     /**
@@ -84,34 +58,23 @@
      * @return the provided contract name.
      */
     public String[] getServiceSpecification() {
-        return m_serviceSpecification;
+        return m_ps.getServiceSpecifications();
     }
 
     /**
-     * Add a property to the current provided service description.
-     * 
-     * @param key : the key of the property
-     * @param value : the value of the property
-     */
-    public void addProperty(String key, String value) {
-        m_properties.put(key, value);
-    }
-
-    /**
-     * Set the set of properties. This function create a clone of the argument.
-     * 
-     * @param props : the properties
-     */
-    public void setProperty(Properties props) {
-        m_properties = props;
-    }
-
-    /**
-     * Get the list of properties.
+     * Gets the list of properties.
+     * A copy of the actual property set is returned.
      * @return the properties.
      */
     public Properties getProperties() {
-        return m_properties;
+        Properties props = new Properties();
+        org.apache.felix.ipojo.util.Property[] ps = m_ps.getProperties();
+        for (int i = 0; i < ps.length; i++) {
+            if (ps[i].getValue() != Property.NO_VALUE) {
+                props.put(ps[i].getName(), ps[i].getValue());
+            }
+        }
+        return props;
     }
 
     /**
@@ -119,15 +82,15 @@
      * @return the state of the provided service (UNREGISTERED | REGISTRED).
      */
     public int getState() {
-        return m_state;
+        return m_ps.getState();
     }
 
     /**
      * Get the service reference.
-     * @return the service reference (null if the service is unregistred).
+     * @return the service reference (null if the service is unregistered).
      */
     public ServiceReference getServiceReference() {
-        return m_serviceReference;
+        return m_ps.getServiceReference();
     }
 
 }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
index 587701d..db8bbe5 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
@@ -23,7 +23,6 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Properties;
 import java.util.Set;
 
 import org.apache.felix.ipojo.ConfigurationException;
@@ -56,6 +55,11 @@
      * The list of the provided service.
      */
     private ProvidedService[] m_providedServices = new ProvidedService[0];
+    
+    /**
+     * The handler description.
+     */
+    private ProvidedServiceHandlerDescription m_description;
 
     /**
      * Add a provided service to the list .
@@ -173,6 +177,9 @@
                 }
                 throw new ConfigurationException("The provided service" + itfs + " is not valid");                
             }
+            
+            // Initialize the description.
+            m_description = new ProvidedServiceHandlerDescription(this, m_providedServices);
 
         }
     }
@@ -466,23 +473,7 @@
      * @see org.apache.felix.ipojo.Handler#getDescription()
      */
     public HandlerDescription getDescription() {
-        ProvidedServiceHandlerDescription pshd = new ProvidedServiceHandlerDescription(this);
-
-        for (int j = 0; j < getProvidedServices().length; j++) {
-            ProvidedService svc = getProvidedServices()[j];
-            ProvidedServiceDescription psd = new ProvidedServiceDescription(svc.getServiceSpecifications(), svc.getState(), svc.getServiceReference());
-
-            Properties props = new Properties();
-            for (int k = 0; k < svc.getProperties().length; k++) {
-                Property prop = svc.getProperties()[k];
-                if (prop.getValue() != null  && prop.getValue() != Property.NO_VALUE) {
-                    props.put(prop.getName(), prop.getValue().toString());
-                }
-            }
-            psd.setProperty(props);
-            pshd.addProvidedService(psd);
-        }
-        return pshd;
+        return m_description;
     }
 
     /**
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandlerDescription.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandlerDescription.java
index eb32da6..71a846b 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandlerDescription.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandlerDescription.java
@@ -20,7 +20,6 @@
 
 import java.util.Iterator;
 
-import org.apache.felix.ipojo.Handler;
 import org.apache.felix.ipojo.architecture.HandlerDescription;
 import org.apache.felix.ipojo.metadata.Attribute;
 import org.apache.felix.ipojo.metadata.Element;
@@ -37,13 +36,18 @@
      * Provided Service Description list.
      */
     private ProvidedServiceDescription[] m_providedServices = new ProvidedServiceDescription[0];
-
+   
     /**
      * Constructor.
-     * @param handler : handler.
+     * @param handler the handler.
+     * @param pss the list of provided service
      */
-    public ProvidedServiceHandlerDescription(Handler handler) {
+    public ProvidedServiceHandlerDescription(ProvidedServiceHandler handler, ProvidedService[] pss) {
         super(handler);
+        m_providedServices = new ProvidedServiceDescription[pss.length];
+        for (int i = 0; i < pss.length; i++) {
+            m_providedServices[i] = new ProvidedServiceDescription(pss[i]);
+        }
     }
 
     /**
@@ -55,27 +59,6 @@
     }
 
     /**
-     * Add a provided service.
-     * 
-     * @param pds : the provided service to add
-     */
-    public void addProvidedService(ProvidedServiceDescription pds) {
-        // Verify that the provided service description is not already in the
-        // array.
-        for (int i = 0; i < m_providedServices.length; i++) {
-            if (m_providedServices[i] == pds) {
-                return; // NOTHING DO DO, the description is already in the
-                        // array
-            }
-        }
-        // The component Description is not in the array, add it
-        ProvidedServiceDescription[] newPSD = new ProvidedServiceDescription[m_providedServices.length + 1];
-        System.arraycopy(m_providedServices, 0, newPSD, 0, m_providedServices.length);
-        newPSD[m_providedServices.length] = pds;
-        m_providedServices = newPSD;
-    }
-
-    /**
      * Build the provided service handler description.
      * @return the handler description.
      * @see org.apache.felix.ipojo.architecture.HandlerDescription#getHandlerInfo()
diff --git a/ipojo/examples/junit4osgi/pom.xml b/ipojo/examples/junit4osgi/pom.xml
index 5166221..e0ad2d3 100644
--- a/ipojo/examples/junit4osgi/pom.xml
+++ b/ipojo/examples/junit4osgi/pom.xml
@@ -28,6 +28,7 @@
 		<module>junit4osgi</module>

 		<module>felix-command</module>

 		<module>maven-junit4osgi-plugin</module>

+		<module>immediate-launcher</module>

   </modules>

 

   <profiles>

@@ -38,7 +39,6 @@
 		</activation>

 		<modules>

 			<module>swing-runner</module>

-			<module>immediate-launcher</module>

 		</modules>

 	</profile>

 	<profile>

@@ -48,7 +48,6 @@
 		</activation>

 		<modules>

 			<module>swing-runner</module>

-			<module>immediate-launcher</module>

 		</modules>

 	</profile>

   </profiles>

diff --git a/ipojo/examples/pom.xml b/ipojo/examples/pom.xml
index 0a910dc..412d598 100644
--- a/ipojo/examples/pom.xml
+++ b/ipojo/examples/pom.xml
@@ -34,7 +34,6 @@
 			<jdk>1.5</jdk>

 		</activation>

 		<modules>

-			<module>junit4osgi</module>

 			<module>property-handler</module>

 		</modules>

 	</profile>

@@ -44,7 +43,6 @@
 			<jdk>1.6</jdk>

 		</activation>

 		<modules>

-			<module>junit4osgi</module>

 			<module>property-handler</module>

 		</modules>

 	</profile>

diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java
index 3a02f60..ea761db 100644
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java
+++ b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java
@@ -24,7 +24,7 @@
 import org.apache.felix.ipojo.Factory;

 import org.apache.felix.ipojo.ServiceContext;

 import org.apache.felix.ipojo.architecture.ComponentTypeDescription;

-import org.apache.felix.ipojo.architecture.InstanceDescription;

+import org.apache.felix.ipojo.composite.CompositeInstanceDescription;

 import org.apache.felix.ipojo.composite.CompositeManager;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.test.composite.util.Utils;

@@ -51,7 +51,7 @@
 		assertEquals("Check offered service", cd.getprovidedServiceSpecification().length, 0);

 		assertEquals("Check configurable properties", cd.getProperties().length, 0);

 		

-		InstanceDescription id = ci.getInstanceDescription();

+		CompositeInstanceDescription id = (CompositeInstanceDescription) ci.getInstanceDescription();

 		assertEquals("Check composite instance name", id.getName(), "empty");

 		assertEquals("Check composite instance state (" + id.getState() + ")", id.getState(), ComponentInstance.VALID);

 		

@@ -100,17 +100,17 @@
 			fail("Unacceptable configuration : " + e.getMessage());

 		}

 		

-		InstanceDescription id = ci.getInstanceDescription();

+		CompositeInstanceDescription id = (CompositeInstanceDescription) ci.getInstanceDescription();

 		assertEquals("Check composite instance name", id.getName(), "empty");

 		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);

 		assertEquals("Check contained instance", id.getContainedInstances().length, 1);

-		InstanceDescription id2 = id.getContainedInstances()[0];

+		CompositeInstanceDescription id2 = (CompositeInstanceDescription) id.getContainedInstances()[0];

 		assertEquals("Check composite instance name", id2.getName(), "empty2");

 		assertEquals("Check composite instance state", id2.getState(), ComponentInstance.VALID);

 		assertEquals("Check contained instance", id2.getContainedInstances().length, 0);

 		

 		ci2.dispose();

-		id = ci.getInstanceDescription();

+		//id = ci.getInstanceDescription();

 		assertEquals("Check composite instance name", id.getName(), "empty");

 		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);

 		assertEquals("Check contained instance", id.getContainedInstances().length, 0);

@@ -150,17 +150,17 @@
 			fail("Unacceptable configuration : " + e.getMessage());

 		}

 		

-		InstanceDescription id = ci.getInstanceDescription();

+		CompositeInstanceDescription id = (CompositeInstanceDescription) ci.getInstanceDescription();

 		assertEquals("Check composite instance name", id.getName(), "empty");

 		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);

 		assertEquals("Check contained instance", id.getContainedInstances().length, 1);

-		InstanceDescription id2 = id.getContainedInstances()[0];

+		CompositeInstanceDescription id2 = (CompositeInstanceDescription) id.getContainedInstances()[0];

 		assertEquals("Check composite instance name", id2.getName(), "empty2");

 		assertEquals("Check composite instance state", id2.getState(), ComponentInstance.VALID);

 		assertEquals("Check contained instance", id2.getContainedInstances().length, 0);

 		

 		ci2.dispose();

-		id = ci.getInstanceDescription();

+		//id = ci.getInstanceDescription();

 		assertEquals("Check composite instance name", id.getName(), "empty");

 		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);

 		assertEquals("Check contained instance", id.getContainedInstances().length, 0);

@@ -200,17 +200,17 @@
 			fail("Unacceptable configuration : " + e.getMessage());

 		}

 		

-		InstanceDescription id = ci.getInstanceDescription();

+		CompositeInstanceDescription id = (CompositeInstanceDescription) ci.getInstanceDescription();

 		assertEquals("Check composite instance name", id.getName(), "empty");

 		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);

 		assertEquals("Check contained instance", id.getContainedInstances().length, 1);

-		InstanceDescription id2 = id.getContainedInstances()[0];

+		CompositeInstanceDescription id2 = (CompositeInstanceDescription) id.getContainedInstances()[0];

 		assertEquals("Check composite instance name", id2.getName(), "empty2");

 		assertEquals("Check composite instance state", id2.getState(), ComponentInstance.VALID);

 		assertEquals("Check contained instance", id2.getContainedInstances().length, 0);

 		

 		ci2.dispose();

-		id = ci.getInstanceDescription();

+		//id = ci.getInstanceDescription();

 		assertEquals("Check composite instance name", id.getName(), "empty");

 		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);

 		assertEquals("Check contained instance", id.getContainedInstances().length, 0);

diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
index f7e2cff..5b41d74 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
@@ -26,6 +26,7 @@
 import org.apache.felix.ipojo.ServiceContext;

 import org.apache.felix.ipojo.architecture.Architecture;

 import org.apache.felix.ipojo.architecture.InstanceDescription;

+import org.apache.felix.ipojo.composite.CompositeInstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.test.composite.service.FooService;

 import org.apache.felix.ipojo.test.composite.util.Utils;

@@ -195,12 +196,11 @@
 		ServiceReference ref = Utils.getServiceReference(getContext(), Architecture.class.getName(), "(architecture.instance=under)");

 		assertNotNull("Check architecture availability", ref);

 		Architecture arch = (Architecture) getContext().getService(ref);

-		InstanceDescription id = arch.getInstanceDescription();

+		CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription();

 		

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		InstanceDescription[] contained = id.getContainedInstances();

 		assertEquals("Check contained instances count (" + contained.length + ")", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 		

@@ -213,11 +213,10 @@
 		ref = Utils.getServiceReference(getContext(), Architecture.class.getName(), "(architecture.instance=under)");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 		

@@ -226,11 +225,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 

@@ -239,11 +237,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.INVALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 0);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 

@@ -252,11 +249,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 

diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
index 8b999e8..2201507 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
@@ -26,6 +26,7 @@
 import org.apache.felix.ipojo.ServiceContext;

 import org.apache.felix.ipojo.architecture.Architecture;

 import org.apache.felix.ipojo.architecture.InstanceDescription;

+import org.apache.felix.ipojo.composite.CompositeInstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.test.composite.service.BarService;

 import org.apache.felix.ipojo.test.composite.util.Utils;

@@ -202,12 +203,11 @@
 		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		Architecture arch = (Architecture) getContext().getService(ref);

-		InstanceDescription id = arch.getInstanceDescription();

+        CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription();

 		

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		InstanceDescription[] contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 3);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");

 		

@@ -220,11 +220,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 2);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");

 		

@@ -233,11 +232,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");

 

@@ -246,11 +244,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.INVALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 0);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");

 

@@ -259,11 +256,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");

 

diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
index 09cbd4b..398c34c 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
@@ -26,6 +26,7 @@
 import org.apache.felix.ipojo.ServiceContext;

 import org.apache.felix.ipojo.architecture.Architecture;

 import org.apache.felix.ipojo.architecture.InstanceDescription;

+import org.apache.felix.ipojo.composite.CompositeInstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.test.composite.service.BarService;

 import org.apache.felix.ipojo.test.composite.util.Utils;

@@ -194,12 +195,11 @@
 		assertNotNull("Check architecture availability", ref);

 		Architecture arch = (Architecture) getContext().getService(ref);

 		assertNotNull("Check architecture", arch);

-		InstanceDescription id = arch.getInstanceDescription();

+        CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		InstanceDescription[] contained = id.getContainedInstances();

 		assertNotNull("Check contained not null", contained);

 		assertEquals("Check contained instances count ("+contained.length+") - 1", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");

 		

@@ -213,11 +213,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");

 		

@@ -226,11 +225,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");

 

@@ -239,11 +237,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 0);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");

 

@@ -252,11 +249,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");

 

@@ -265,15 +261,6 @@
 		fact2.start();

 		fact3.start();

 	}

-	

-	

-	

-	

-	

-	

-	

-	

-	

-	

+

 

 }

diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
index 193adaf..04f81c4 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
@@ -26,6 +26,7 @@
 import org.apache.felix.ipojo.ServiceContext;

 import org.apache.felix.ipojo.architecture.Architecture;

 import org.apache.felix.ipojo.architecture.InstanceDescription;

+import org.apache.felix.ipojo.composite.CompositeInstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.test.composite.service.BarService;

 import org.apache.felix.ipojo.test.composite.util.Utils;

@@ -192,12 +193,11 @@
 		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		Architecture arch = (Architecture) getContext().getService(ref);

-		InstanceDescription id = arch.getInstanceDescription();

+        CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription();

 		

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		InstanceDescription[] contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 		

@@ -210,11 +210,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 		

@@ -223,11 +222,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 

@@ -236,11 +234,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.INVALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 0);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 

@@ -249,11 +246,10 @@
 		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");

 		assertNotNull("Check architecture availability", ref);

 		arch = (Architecture) getContext().getService(ref);

-		id = arch.getInstanceDescription();

+		//id = arch.getInstanceDescription();

 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);

 		contained = id.getContainedInstances();

 		assertEquals("Check contained instances count", contained.length, 1);

-		assertEquals("Check that no object are created" , id.getCreatedObjects().length, 0);

 		assertEquals("Check instance name" , id.getName(), "under");

 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");

 

diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableFooProvider.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableFooProvider.java
index e4bfcb4..693ff1b 100644
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableFooProvider.java
+++ b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableFooProvider.java
@@ -10,7 +10,7 @@
     private int invokeCount = 0;
     
     public void setMessage(String message) {
-        System.out.println("Set message to " + message);
+        System.err.println("=== Set message to " + message);
         this.message = message;
         invokeCount++;
     }
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java
index d912e17..01f9590 100644
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java
+++ b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java
@@ -5,6 +5,7 @@
 import java.util.Properties;
 
 import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.architecture.Architecture;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.test.scenarios.configadmin.service.FooService;
@@ -76,21 +77,28 @@
         
         String pid = configuration.getPid();
         
+        // Wait for the processing of the first configuration.
+        try {
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
+        
         //  The instance should be created, wait for the architecture service
         Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         props.put("message", "message2");
         try {
@@ -105,11 +113,11 @@
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         try {
             configuration.delete();
@@ -145,11 +153,18 @@
         String pid = configuration.getPid();
         System.out.println("PID : " + pid);
         
+        // Wait for the processing of the first configuration.
+        try {
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
+        
         //  The instance should be created, wait for the architecture service
         Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         props.put("message", "message2");
         try {
@@ -160,20 +175,20 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check object -2", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check object -2", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         //Invoke
         FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+       // architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
                 
         try {
             configuration.delete();
@@ -208,26 +223,41 @@
         
         String pid = configuration.getPid();
         
+        // Wait for the processing of the first configuration.
+        try {
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
+        
         assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
         
         factory.start();
+
         
+        // Wait for the processing of the first configuration.
+        try {
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
+
         
         //  The instance should be created, wait for the architecture service
         Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         props.put("message", "message2");
         try {
@@ -242,12 +272,12 @@
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+       // architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         //assertEquals("Assert count", 2, count);
         // This test was removed as the result can be 3. 
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         try {
             configuration.delete();
@@ -283,16 +313,30 @@
         
         String pid = configuration.getPid();
         
+        // Wait for the processing of the first configuration.
+        try {
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
+        
         assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
         
         factory.start();
         
+        // Wait for the processing of the first configuration.
+        try {
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
+
         
         //  The instance should be created, wait for the architecture service
         Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         props.put("message", "message2");
         try {
@@ -303,20 +347,20 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check object -1", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check object -1", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         //Invoke
         FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+       // architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
                 
         try {
             configuration.delete();
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java
index 4ad16d7..3429f96 100644
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java
+++ b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java
@@ -5,6 +5,7 @@
 import java.util.Properties;
 
 import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.architecture.Architecture;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.test.scenarios.configadmin.service.FooService;
@@ -81,36 +82,56 @@
         Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check no object", 0, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);        
         
+        Utils.waitForService(getContext(), FooService.class.getName(), "(instance.name="+pid+")");       
+        
+        ServiceReference refx = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
+        assertNotNull("Check refx", refx);
         FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
+        assertNotNull("Check fs", fs);
+        
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
-        props.put("message", "message2");
+        
+        // Wait for the processing of the first configuration.
         try {
-            configuration.update(props);
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
+        
+        
+        Dictionary p2 = configuration.getProperties();
+        p2.put("message", "message2");
+        try {
+            System.err.println("The configuration will be updated with message2");
+
+            configuration.update(p2);
             // Update the configuration ...
             Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
         } catch (Exception e) {
             fail(e.getMessage());
         }
         
+        System.err.println("The configuration should be updated with message2");
+        
         fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         try {
             configuration.delete();
@@ -149,7 +170,14 @@
         Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check no object", 0, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
+        
+        // Wait for the processing of the first configuration.
+        try {
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
         
         props.put("message", "message2");
         try {
@@ -160,20 +188,20 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+       // architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check no object -2", 0, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object -2", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         //Invoke
         FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
                 
         try {
             configuration.delete();
@@ -217,17 +245,26 @@
         Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check no object", 0, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
+        Utils.waitForService(getContext(), FooService.class.getName(), "(instance.name="+pid+")");       
         FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
+        
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+       // architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
+        
+     // Wait for the processing of the first configuration.
+        try {
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
         
         System.out.println("===");
         
@@ -246,11 +283,11 @@
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+       // architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         try {
             configuration.delete();
@@ -296,7 +333,14 @@
         Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check no object", 0, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
+        
+     // Wait for the processing of the first configuration.
+        try {
+            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
+        } catch (InterruptedException e1) {
+            fail(e1.getMessage());
+        }
         
         props.put("message", "message2");
         try {
@@ -307,20 +351,20 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
-        assertEquals("Check no object -2", 0, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object -2", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
         
         //Invoke
         FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+       // architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
                 
         try {
             configuration.delete();
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java
index c050b16..655f288 100644
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java
+++ b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java
@@ -6,6 +6,7 @@
 
 import org.apache.felix.ipojo.ComponentFactory;
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.architecture.Architecture;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.test.scenarios.configadmin.service.FooService;
@@ -68,14 +69,14 @@
         }
         
         ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message", mes);
         assertEquals("Check count", 1, count);
         
@@ -96,14 +97,14 @@
         }
         
         ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message2", mes);
         assertEquals("Check count", 2, count);
         
@@ -131,15 +132,15 @@
         Architecture arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         
         ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
-        assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+       // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message", mes);
         assertEquals("Check count", 1, count);
         
@@ -159,17 +160,17 @@
             fail(e.getMessage());
         }
         
-        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+      //  arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
-        assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
 
-        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+       // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message2", mes);
         assertEquals("Check count", 2, count);
         
@@ -211,14 +212,14 @@
         }
         
         ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
       //  int count1 = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message - 1 (" + mes +")", "message2", mes); // Already reconfigured.
        // assertEquals("Check count", 2, count); // Two : 1) "message" on immediate, "message2" on the reconfiguration, 
                                                 // not necessary as the property can be set before the immediate instance creation
@@ -251,14 +252,14 @@
            fail(e.getMessage());
         }
         ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
        // int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message already reconfigured", "message3", mes); // Already reconfigured.
         //assertEquals("Check count", count1 + 1, count); // message before the reconfiguration, message3 after the reconfiguration
         
@@ -297,14 +298,14 @@
         }
         
         ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
       // int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message2", mes); // Already reconfigured.
         //assertEquals("Check count", 1, count);
         
@@ -337,14 +338,14 @@
         }
         
         ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
       //  count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message3", mes); // Already reconfigured.
        // assertEquals("Check count", 1, count);
         
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java
index 043c84d..047b488 100644
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java
+++ b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java
@@ -6,6 +6,7 @@
 
 import org.apache.felix.ipojo.ComponentFactory;
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.architecture.Architecture;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.test.scenarios.configadmin.service.FooService;
@@ -68,14 +69,14 @@
         }
         
         ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message", mes);
         assertEquals("Check count", 1, count);
         
@@ -95,14 +96,14 @@
         }
         
         ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message2", mes);
         assertEquals("Check count", 2, count);
         
@@ -130,15 +131,15 @@
         Architecture arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         
         ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
-        assertEquals("Check no object", 0, arch.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message", mes);
         assertEquals("Check count", 1, count);
         
@@ -157,17 +158,17 @@
             fail(e.getMessage());
         }
         
-        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
-        assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
 
-        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message2", mes);
         assertEquals("Check count", 2, count);
         
@@ -209,14 +210,14 @@
         }
         
         ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message2", mes); // Already reconfigured.
         assertEquals("Check count", 1, count);
         
@@ -249,14 +250,14 @@
         }
         
         ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message3", mes); // Already reconfigured.
         assertEquals("Check count", 1, count);
         
@@ -295,14 +296,14 @@
         }
         
         ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message2", mes); // Already reconfigured.
         assertEquals("Check count", 1, count);
         
@@ -335,14 +336,14 @@
         }
         
         ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
         fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
         assertEquals("Check message", "message3", mes); // Already reconfigured.
         assertEquals("Check count", 1, count);
         
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
index d26e61a..2c1bed2 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
@@ -21,8 +21,8 @@
 import java.util.Properties;

 

 import org.apache.felix.ipojo.ComponentInstance;

+import org.apache.felix.ipojo.PrimitiveInstanceDescription;

 import org.apache.felix.ipojo.architecture.Architecture;

-import org.apache.felix.ipojo.architecture.InstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;

 import org.apache.felix.ipojo.test.scenarios.util.Utils;

@@ -56,7 +56,7 @@
 		// Check instance is invalid

 		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ref);

-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);

 		assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);

 		

@@ -64,7 +64,7 @@
 		fooProvider.start();

 		

 		// Check instance validity

-		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

 		assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);

 		

 		// Check service providing

@@ -81,7 +81,7 @@
 		

 		fooProvider.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);

 		

 		assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);

@@ -89,7 +89,7 @@
 		fooProvider.start();

 		

 		// Check instance validity

-		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

 		assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);

 		

 		// Check service providing

diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
index 1fe3f1e..c39f7ed 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
@@ -21,8 +21,8 @@
 import java.util.Properties;

 

 import org.apache.felix.ipojo.ComponentInstance;

+import org.apache.felix.ipojo.PrimitiveInstanceDescription;

 import org.apache.felix.ipojo.architecture.Architecture;

-import org.apache.felix.ipojo.architecture.InstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService;

 import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;

@@ -58,7 +58,7 @@
         // Check instance is invalid

         ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());

         assertNotNull("Check architecture availability", arch_ref);

-        InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);

         assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);

         

@@ -66,7 +66,7 @@
         fooProvider.start();

         

         // Check instance validity

-        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);

         

         // Check service providing

@@ -84,7 +84,7 @@
         

         fooProvider.stop();

         

-        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);

         

         assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);

@@ -92,7 +92,7 @@
         fooProvider.start();

         

         // Check instance validity

-        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);

         

         // Check service providing

diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
index ec55c3e..07eb5a3 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
@@ -21,6 +21,7 @@
 import java.util.Properties;

 

 import org.apache.felix.ipojo.ComponentInstance;

+import org.apache.felix.ipojo.PrimitiveInstanceDescription;

 import org.apache.felix.ipojo.architecture.Architecture;

 import org.apache.felix.ipojo.architecture.InstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

@@ -59,7 +60,7 @@
         // Check instance is invalid

         ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());

         assertNotNull("Check architecture availability", arch_ref);

-        InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);

         assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);

         

@@ -67,7 +68,7 @@
         fooProvider.start();

         

         // Check instance validity

-        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+       // id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);

         

         // Check service providing

@@ -83,7 +84,7 @@
         

         fooProvider.stop();

         

-        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);

         

         assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);

@@ -91,7 +92,7 @@
         fooProvider.start();

         

         // Check instance validity

-        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+       // id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);

         

         // Check service providing

diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
index f700aed..dae2876 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
@@ -21,6 +21,7 @@
 import java.util.Properties;

 

 import org.apache.felix.ipojo.ComponentInstance;

+import org.apache.felix.ipojo.PrimitiveInstanceDescription;

 import org.apache.felix.ipojo.architecture.Architecture;

 import org.apache.felix.ipojo.architecture.InstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

@@ -56,7 +57,7 @@
         // Check instance is invalid

         ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());

         assertNotNull("Check architecture availability", arch_ref);

-        InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription)((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);

         assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);

         

@@ -64,7 +65,7 @@
         fooProvider.start();

         

         // Check instance validity

-        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);

         

         // Check service providing

@@ -80,7 +81,7 @@
         

         fooProvider.stop();

         

-        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);

         

         assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);

@@ -88,7 +89,7 @@
         fooProvider.start();

         

         // Check instance validity

-        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

         assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);

         

         // Check service providing

diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
index 569493b..94145c9 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
@@ -21,8 +21,8 @@
 import java.util.Properties;

 

 import org.apache.felix.ipojo.ComponentInstance;

+import org.apache.felix.ipojo.PrimitiveInstanceDescription;

 import org.apache.felix.ipojo.architecture.Architecture;

-import org.apache.felix.ipojo.architecture.InstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;

 import org.apache.felix.ipojo.test.scenarios.util.Utils;

@@ -56,14 +56,14 @@
 		// Check instance is invalid

 		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ref);

-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);

 		

 		// Start fooprovider

 		fooProvider.start();

 		

 		// Check instance validity

-		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

 		assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);

 		

 		// Check service providing

@@ -76,13 +76,13 @@
 		

 		fooProvider.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);

 		

 		fooProvider.start();

 		

 		// Check instance validity

-		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();

 		assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);

 		

 		// Check service providing

diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
index 175205a..c025168 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
@@ -21,16 +21,16 @@
 import java.util.Properties;

 

 import org.apache.felix.ipojo.ComponentInstance;

+import org.apache.felix.ipojo.PrimitiveInstanceDescription;

 import org.apache.felix.ipojo.architecture.Architecture;

 import org.apache.felix.ipojo.architecture.InstanceDescription;

 import org.apache.felix.ipojo.handlers.dependency.DependencyHandlerDescription;

 import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandlerDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

-import org.apache.felix.ipojo.test.scenarios.util.Utils;

-import org.osgi.framework.ServiceReference;

-

 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;

 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;

+import org.apache.felix.ipojo.test.scenarios.util.Utils;

+import org.osgi.framework.ServiceReference;

 

 public class DependencyArchitectureTest extends OSGiTestCase {

 	

@@ -86,29 +86,29 @@
 	}

 	

 	private DependencyHandlerDescription getDependencyDesc(InstanceDescription id) {

-		for(int i = 0; i < id.getHandlers().length; i++) {

-			if(id.getHandlers()[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.dependency.DependencyHandler")) {

-				return (DependencyHandlerDescription) id.getHandlers()[i];

-			}

+	    DependencyHandlerDescription handler = (DependencyHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:requires");

+		if (handler == null) {

+		    fail("Dependency Handler not found");

+		    return null;

+		} else {

+		    return handler;

 		}

-		fail("Dependency Handler not found");

-		return null;

 	}

 	

 	private ProvidedServiceHandlerDescription getPSDesc(InstanceDescription id) {

-		for(int i = 0; i < id.getHandlers().length; i++) {

-			if(id.getHandlers()[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {

-				return (ProvidedServiceHandlerDescription) id.getHandlers()[i];

-			}

-		}

-		fail("Provided Service Handler not found");

-		return null;

+	    ProvidedServiceHandlerDescription handler = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");

+        if (handler == null) {

+            fail("Provided Service Handler not found");

+            return null;

+        } else {

+            return handler;

+        }

 	}

 	

 	public void testSimpleDependency() {

 		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());

 		assertNotNull("Check architecture availability", arch_dep);

-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);

 		

 		// Check dependency handler invalidity

@@ -126,10 +126,10 @@
 		

 		ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps);

-		InstanceDescription id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

+		PrimitiveInstanceDescription id_ps = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler validity", dhd.isValid());

@@ -141,9 +141,9 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

+		//id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertEquals("Check POJO creation", id_ps.getCreatedObjects().length, 1);

@@ -151,18 +151,18 @@
 		

 		fooProvider1.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);

 		dhd = getDependencyDesc(id_dep);

 		assertFalse("Check dependency handler invalidity", dhd.isValid());

 		

 		fooProvider1.start();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

 		arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps);

-		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

+		//id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);

 		psh = getPSDesc(id_ps);

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

@@ -176,16 +176,16 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph 

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

+		//id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

 		psh = getPSDesc(id_ps);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));

 		

 		fooProvider1.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);

 		dhd = getDependencyDesc(id_dep);

 		assertFalse("Check dependency handler invalidity", dhd.isValid());

@@ -199,7 +199,7 @@
 	public void testOptionalDependency() {

 		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());

 		assertNotNull("Check architecture availability", arch_dep);

-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);

 		

 		// Check dependency handler invalidity

@@ -217,10 +217,10 @@
 		

 		ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps);

-		InstanceDescription id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

+		PrimitiveInstanceDescription id_ps = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler validity", dhd.isValid());

@@ -232,9 +232,9 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

+		//id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertEquals("Check POJO creation", id_ps.getCreatedObjects().length, 1);

@@ -242,18 +242,18 @@
 		

 		fooProvider1.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler invalidity", dhd.isValid());

 		

 		fooProvider1.start();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

 		arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps);

-		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

+		//id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);

 		psh = getPSDesc(id_ps);

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

@@ -267,16 +267,16 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph 

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

+		//id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();

 		psh = getPSDesc(id_ps);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));

 		

 		fooProvider1.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler invalidity", dhd.isValid());

@@ -290,7 +290,7 @@
 	public void testMultipleDependency() {

 		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());

 		assertNotNull("Check architecture availability", arch_dep);

-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);

 		

 		// Check dependency handler invalidity

@@ -307,10 +307,10 @@
 		

 		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps1);

-		InstanceDescription id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		PrimitiveInstanceDescription id_ps1 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		assertTrue("Check instance validity - 1", id_ps1.getState() == ComponentInstance.VALID);				

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler validity", dhd.isValid());

@@ -323,9 +323,9 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps1);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);

@@ -338,12 +338,12 @@
 		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps1);

 		assertNotNull("Check architecture 2 availability", arch_ps2);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

-		InstanceDescription id_ps2 = ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		PrimitiveInstanceDescription id_ps2 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);

 		assertTrue("Check instance 2 invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler validity", dhd.isValid());

@@ -356,10 +356,10 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

-		id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		ProvidedServiceHandlerDescription psh1 = getPSDesc(id_ps1);

 		ProvidedServiceHandlerDescription psh2 = getPSDesc(id_ps2);

 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);

@@ -372,10 +372,10 @@
 		

 		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps1);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		assertTrue("Check instance validity - 1", id_ps1.getState() == ComponentInstance.VALID);				

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler validity", dhd.isValid());

@@ -388,9 +388,9 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		psh = getPSDesc(id_ps1);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);

@@ -399,20 +399,22 @@
 		

 		fooProvider1.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertFalse("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertFalse("Check dependency handler invalidity", dhd.isValid());

 		

 		fooProvider2.start();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());

+		arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps1);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

-		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);

-		psh = getPSDesc(id_ps1);

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		

+		assertTrue("Check instance invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);

+		

+		psh = getPSDesc(id_ps2);

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		assertTrue("Check dependency handler validity", dhd.isValid());

 		

@@ -425,17 +427,17 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph 

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

-		psh = getPSDesc(id_ps1);

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		psh = getPSDesc(id_ps2);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertTrue("Check service reference - 4", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));

 		assertEquals("Check used ref - 7 ", dhd.getDependencies()[0].getUsedServices().size(), 1);

 		

 		fooProvider2.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertFalse("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertFalse("Check dependency handler invalidity", dhd.isValid());

@@ -449,7 +451,7 @@
 	public void testMultipleOptionalDependency() {

 		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());

 		assertNotNull("Check architecture availability", arch_dep);

-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);

 		

 		// Check dependency handler invalidity

@@ -466,10 +468,10 @@
 		

 		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps1);

-		InstanceDescription id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		PrimitiveInstanceDescription id_ps1 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);				

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler validity", dhd.isValid());

@@ -481,9 +483,9 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps1);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);

@@ -496,12 +498,12 @@
 		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps1);

 		assertNotNull("Check architecture 2 availability", arch_ps2);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

-		InstanceDescription id_ps2 = ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		PrimitiveInstanceDescription id_ps2 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);

 		assertTrue("Check instance 2 invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler validity", dhd.isValid());

@@ -513,10 +515,10 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

-		id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		ProvidedServiceHandlerDescription psh1 = getPSDesc(id_ps1);

 		ProvidedServiceHandlerDescription psh2 = getPSDesc(id_ps2);

 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);

@@ -528,10 +530,10 @@
 		

 		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());

 		assertNotNull("Check architecture availability", arch_ps1);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);				

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler validity", dhd.isValid());

@@ -543,9 +545,9 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

 		psh = getPSDesc(id_ps1);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);

@@ -553,20 +555,20 @@
 

 		fooProvider1.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler invalidity", dhd.isValid());

 		

 		fooProvider2.start();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());

-		assertNotNull("Check architecture availability", arch_ps1);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

-		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);

-		psh = getPSDesc(id_ps1);

+		arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());

+		assertNotNull("Check architecture availability", arch_ps2);

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		assertTrue("Check instance invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);

+		psh = getPSDesc(id_ps2);

 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);

 		assertTrue("Check dependency handler validity", dhd.isValid());

 		

@@ -578,16 +580,16 @@
 		assertTrue("check CheckService invocation", cs.check());

 		

 		// Check object graph 

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		dhd = getDependencyDesc(id_dep);

-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

-		psh = getPSDesc(id_ps1);

+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();

+		psh = getPSDesc(id_ps2);

 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());

 		assertTrue("Check service reference - 4", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));

 

 		fooProvider2.stop();

 		

-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();

 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);

 		dhd = getDependencyDesc(id_dep);

 		assertTrue("Check dependency handler invalidity", dhd.isValid());

diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java
index f5635f4..ec1a58c 100644
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java
+++ b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java
@@ -3,6 +3,7 @@
 import java.util.Properties;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1;
@@ -43,7 +44,7 @@
     }
     
     private void checkCreatedObjects(ComponentInstance ci, int expected) {
-        assertEquals("Number of created objects", expected, ci.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
     }
     
     public void testOneService() {
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java
index e59b2ce..5343ca9 100644
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java
+++ b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java
@@ -3,6 +3,7 @@
 import java.util.Properties;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1;
@@ -43,7 +44,7 @@
     }
     
     private void checkCreatedObjects(ComponentInstance ci, int expected) {
-        assertEquals("Number of created objects", expected, ci.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
     }
     
     public void testOneService() {
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
index 15ac19d..bcb3a4c 100644
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
+++ b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
@@ -68,12 +68,14 @@
 		

 		//Look for the ProvidedService Handler

 		ProvidedServiceHandlerDescription pshd = null;

-		for(int i = 0; i < handlers.length; i++) {

-			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {

-				pshd = (ProvidedServiceHandlerDescription) handlers[i];

-			}

-		}

-		

+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");

+

+//		for(int i = 0; i < handlers.length; i++) {

+//			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {

+//				pshd = (ProvidedServiceHandlerDescription) handlers[i];

+//			}

+//		}

+//		

 		assertNotNull("Check ProvidedServiceHandlerDescription", pshd);

 		ProvidedServiceDescription[] ps = pshd.getProvidedServices();

 		

@@ -117,11 +119,8 @@
 		

 		//Look for the ProvidedService Handler

 		ProvidedServiceHandlerDescription pshd = null;

-		for(int i = 0; i < handlers.length; i++) {

-			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {

-				pshd = (ProvidedServiceHandlerDescription) handlers[i];

-			}

-		}

+		pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");

+

 		

 		assertNotNull("Check ProvidedServiceHandlerDescription", pshd);

 		ProvidedServiceDescription[] ps = pshd.getProvidedServices();

@@ -136,9 +135,9 @@
 		assertEquals("Check service properties number (#" + prop + "?=5)" , prop.size(), 5);

 		assertEquals("Check instance.name property", prop.getProperty("instance.name"), compName);

 		assertEquals("Check factory.name property", prop.getProperty("factory.name"), factName);

-		assertEquals("Check foo property", prop.getProperty("foo"), "foo");

-		assertEquals("Check bar property", prop.getProperty("bar"), "2");

-		assertEquals("Check baz property", prop.getProperty("baz"), "baz");

+		assertEquals("Check foo property", prop.get("foo"), "foo");

+		assertEquals("Check bar property", prop.get("bar"), new Integer(2));

+		assertEquals("Check baz property", prop.get("baz"), "baz");

 		

 	}

 	

@@ -166,11 +165,13 @@
 		

 		//Look for the ProvidedService Handler

 		ProvidedServiceHandlerDescription pshd = null;

-		for(int i = 0; i < handlers.length; i++) {

-			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {

-				pshd = (ProvidedServiceHandlerDescription) handlers[i];

-			}

-		}

+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");

+

+//		for(int i = 0; i < handlers.length; i++) {

+//			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {

+//				pshd = (ProvidedServiceHandlerDescription) handlers[i];

+//			}

+//		}

 		

 		assertNotNull("Check ProvidedServiceHandlerDescription", pshd);

 		ProvidedServiceDescription[] ps = pshd.getProvidedServices();

@@ -207,11 +208,13 @@
     	

     	//Look for the ProvidedService Handler

     	ProvidedServiceHandlerDescription pshd = null;

-    	for(int i = 0; i < handlers.length; i++) {

-    		if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {

-    			pshd = (ProvidedServiceHandlerDescription) handlers[i];

-    		}

-    	}

+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");

+

+//    	for(int i = 0; i < handlers.length; i++) {

+//    		if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {

+//    			pshd = (ProvidedServiceHandlerDescription) handlers[i];

+//    		}

+//    	}

     	

     	assertNotNull("Check ProvidedServiceHandlerDescription", pshd);

     	ProvidedServiceDescription[] ps = pshd.getProvidedServices();

diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
index 165d1e1..605e339 100644
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
+++ b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
@@ -21,6 +21,7 @@
 import java.util.Properties;

 

 import org.apache.felix.ipojo.ComponentInstance;

+import org.apache.felix.ipojo.PrimitiveInstanceDescription;

 import org.apache.felix.ipojo.architecture.Architecture;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;

@@ -110,50 +111,50 @@
 	 * Check lazy creation.

 	 */

 	public void testLazyCreation() {

-		assertEquals("Check that no objects are created ", 0, lazzyArch.getInstanceDescription().getCreatedObjects().length);

+		assertEquals("Check that no objects are created ", 0, ((PrimitiveInstanceDescription) lazzyArch.getInstanceDescription()).getCreatedObjects().length);

 		ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());

 		assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available",ref);

 		FooService fs = (FooService) getServiceObject(ref);

 		assertTrue("Check the FooService invocation", fs.foo());

-		assertEquals("Check the creation of 1 object",1, lazzyArch.getInstanceDescription().getCreatedObjects().length);

+		assertEquals("Check the creation of 1 object",1,  ((PrimitiveInstanceDescription) lazzyArch.getInstanceDescription()).getCreatedObjects().length);

 	}

 	

 	/**

 	 * Check lazy and singleton creation.

 	 */

 	public void testLazyCreationSingleton() {

-        assertEquals("Check that no objects are created ", 0, lazzyArchSing.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check that no objects are created ", 0,  ((PrimitiveInstanceDescription) lazzyArchSing.getInstanceDescription()).getCreatedObjects().length);

         ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_sing.getInstanceName());

         assertNotNull("Check that a FooService from " + ci_lazzy_sing.getInstanceName() + " is available",ref);

         FooService fs = (FooService) getServiceObject(ref);

         assertTrue("Check the FooService invocation", fs.foo());

-        assertEquals("Check the creation of 1 object",1, lazzyArchSing.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check the creation of 1 object",1,  ((PrimitiveInstanceDescription) lazzyArchSing.getInstanceDescription()).getCreatedObjects().length);

     }

 	

 	/**

 	 * Check lazy and "several" creation.

 	 */

 	public void testLazyCreationSeveral() {

-        assertEquals("Check that no objects are created ", 0, lazzyArchSev.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check that no objects are created ", 0,  ((PrimitiveInstanceDescription) lazzyArchSev.getInstanceDescription()).getCreatedObjects().length);

         ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_sev.getInstanceName());

         assertNotNull("Check that a FooService from " + ci_lazzy_sev.getInstanceName() + " is available", ref);

         FooService fs = (FooService) getServiceObject(ref);

         FooService fs2 = (FooService) getServiceObject(ref);

         assertTrue("Check the FooService invocation", fs.foo());

         assertTrue("Check the FooService invocation-2", fs2.foo());

-        assertEquals("Check the creation of 1 object",1, lazzyArchSev.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSev.getInstanceDescription()).getCreatedObjects().length);

     }

 	

 	/**

 	 * Check immediate creation.

 	 */

 	public void testImmediateCreation() {

-		assertEquals("Check that one object is created ", 1, immeArch.getInstanceDescription().getCreatedObjects().length);

+		assertEquals("Check that one object is created ", 1, ((PrimitiveInstanceDescription) immeArch.getInstanceDescription()).getCreatedObjects().length);

 		ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_immediate.getInstanceName());

 		assertNotNull("Check that a FooService from " + ci_immediate.getInstanceName() + " is available", ref);

 		FooService fs = (FooService) getServiceObject(ref);

 		assertTrue("Check the FooService invocation", fs.foo());

-		assertEquals("Check the creation of 1 object", 1, immeArch.getInstanceDescription().getCreatedObjects().length);

+		assertEquals("Check the creation of 1 object", 1, ((PrimitiveInstanceDescription) immeArch.getInstanceDescription()).getCreatedObjects().length);

 	}

     

     /**

@@ -165,19 +166,19 @@
         FooService fs = (FooService) getServiceObject(ref);

         Properties p = fs.fooProps();

         assertNotNull("Check the bundle context", p.get("context"));

-        assertEquals("Check the creation of 1 object",1, lazzyArch.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArch.getInstanceDescription()).getCreatedObjects().length);

     }

 

     /**

      * Test immediate singleton creation.

      */

     public void testImmediateSingletonCreation() {

-    	assertEquals("Check that one object is created ", 1, immeArchSing.getInstanceDescription().getCreatedObjects().length);

+    	assertEquals("Check that one object is created ", 1, ((PrimitiveInstanceDescription) immeArchSing.getInstanceDescription()).getCreatedObjects().length);

     	ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_immediate_singleton.getInstanceName());

     	assertNotNull("Check that a FooService from " + ci_immediate_singleton.getInstanceName() + " is available",ref);

     	FooService fs = (FooService) getServiceObject(ref);

     	assertTrue("Check the FooService invocation", fs.foo());

-    	assertEquals("Check the creation of 1 object", 1, immeArchSing.getInstanceDescription().getCreatedObjects().length);

+    	assertEquals("Check the creation of 1 object", 1, ((PrimitiveInstanceDescription) immeArchSing.getInstanceDescription()).getCreatedObjects().length);

     }

 

     /**

@@ -185,14 +186,14 @@
      * (lazy & singleton creation)

      */

     public void testLazyCreationSingletonM() {

-        assertEquals("Check that no objects are created ", 0, lazzyArchSingM.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check that no objects are created ", 0, ((PrimitiveInstanceDescription) lazzyArchSingM.getInstanceDescription()).getCreatedObjects().length);

         ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_singM.getInstanceName());

         assertNotNull("Check that a FooService from " + ci_lazzy_singM.getInstanceName() + " is available",ref);

         FooService fs = (FooService) getServiceObject(ref);

         FooService fs2 = (FooService) getServiceObject(ref);

         assertTrue("Check the FooService invocation", fs.foo());

         assertTrue("Check the FooService invocation", fs2.foo());

-        assertEquals("Check the creation of 1 object",1, lazzyArchSingM.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSingM.getInstanceDescription()).getCreatedObjects().length);

     }

 

     /**

@@ -200,16 +201,16 @@
      * (lazy & several creation)

      */

     public void testLazyCreationSeveralM() {

-        assertEquals("Check that no objects are created ", 0, lazzyArchSevM.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check that no objects are created ", 0, ((PrimitiveInstanceDescription) lazzyArchSevM.getInstanceDescription()).getCreatedObjects().length);

         ServiceReference ref= helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_sevM.getInstanceName());

         assertNotNull("Check that a FooService from " + ci_lazzy_sevM.getInstanceName() + " is available",ref);

         FooService fs = (FooService) getServiceObject(ref);

         assertTrue("Check the FooService invocation", fs.foo());

-        assertEquals("Check the creation of 1 object",1, lazzyArchSevM.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSevM.getInstanceDescription()).getCreatedObjects().length);

         FooService fs2 = (FooService) getServiceObject(ref);

         assertTrue("Check the FooService invocation-2", fs2.foo());

         // Only one object as the getService method is called only once (service factory) despite the policy="method".

-        assertEquals("Check the creation of 1 object",1, lazzyArchSevM.getInstanceDescription().getCreatedObjects().length);

+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSevM.getInstanceDescription()).getCreatedObjects().length);

     }

     

     /**

diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
index 04efa5d..88144c0 100644
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
+++ b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
@@ -23,6 +23,7 @@
 import org.apache.felix.ipojo.ComponentInstance;

 import org.apache.felix.ipojo.Factory;

 import org.apache.felix.ipojo.Pojo;

+import org.apache.felix.ipojo.PrimitiveInstanceDescription;

 import org.apache.felix.ipojo.architecture.InstanceDescription;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;

@@ -82,7 +83,7 @@
 		assertEquals("Check component instance name", instance.getInstanceName(), compName);

 		assertEquals("Check component factory name", instance.getFactory().getName(), factName);

 		assertNotNull("Instance description not null", instance.getInstanceDescription());

-		InstanceDescription id = instance.getInstanceDescription();

+		PrimitiveInstanceDescription id = (PrimitiveInstanceDescription) instance.getInstanceDescription();

 		assertTrue("Check instance state", id.getState() == ComponentInstance.VALID);

 		assertEquals("Check created pojo count", id.getCreatedObjects().length, 1);

 		assertEquals("Check instance description name", id.getName(), compName);