commit | 22cb76383da7bdbd7239c698f54a0768f0ad1d34 | [log] [tgz] |
---|---|---|
author | Richard S. Hall <rickhall@apache.org> | Mon Apr 23 14:19:17 2007 +0000 |
committer | Richard S. Hall <rickhall@apache.org> | Mon Apr 23 14:19:17 2007 +0000 |
tree | 6a5094922e087e46ebc2aa8e243c079cda658ddd | |
parent | f58d361e4c0417b49acb6e16e140a8bbad82a71d [diff] |
Applied patch (FELIX-273) to correctly dispose created component instances once a factory goes away. git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@531477 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/src/main/java/org/apache/felix/ipojo/InstanceCreator.java b/ipojo/src/main/java/org/apache/felix/ipojo/InstanceCreator.java index 2254a1a..65dd0ca 100644 --- a/ipojo/src/main/java/org/apache/felix/ipojo/InstanceCreator.java +++ b/ipojo/src/main/java/org/apache/felix/ipojo/InstanceCreator.java
@@ -218,7 +218,7 @@ m_context.removeServiceListener(this); for (int i = 0; i < m_configurations.length; i++) { if (m_configurations[i].getInstance() != null) { - m_configurations[i].getInstance().stop(); + m_configurations[i].getInstance().dispose(); } m_configurations[i].setInstance(null); m_configurations[i].setFactory(null);
diff --git a/ipojo/src/main/java/org/apache/felix/ipojo/architecture/ComponentDescription.java b/ipojo/src/main/java/org/apache/felix/ipojo/architecture/ComponentDescription.java index 6826c70..45e23ad 100644 --- a/ipojo/src/main/java/org/apache/felix/ipojo/architecture/ComponentDescription.java +++ b/ipojo/src/main/java/org/apache/felix/ipojo/architecture/ComponentDescription.java
@@ -109,6 +109,10 @@ * @param pd : the property to add */ public void addProperty(PropertyDescription pd) { + if (pd.getName().equals("name")) { + pd = new PropertyDescription(pd.getName(), pd.getType(), null); // Erase the instance name + } + for (int i = 0; i < m_properties.length; i++) { if (m_properties[i].getName().equals(pd.getName())) { return;