felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1202539 - in /felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm: DependencyActivatorBase.java DependencyManager.java
Date Wed, 16 Nov 2011 06:28:10 GMT
Author: marrs
Date: Wed Nov 16 06:28:10 2011
New Revision: 1202539

URL: http://svn.apache.org/viewvc?rev=1202539&view=rev
Log:
FELIX-3042 committed the supplied patch

Modified:
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyActivatorBase.java
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyActivatorBase.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyActivatorBase.java?rev=1202539&r1=1202538&r2=1202539&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyActivatorBase.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyActivatorBase.java
Wed Nov 16 06:28:10 2011
@@ -20,7 +20,6 @@ package org.apache.felix.dm;
 
 import java.util.List;
 
-import org.apache.felix.dm.impl.ComponentImpl;
 import org.apache.felix.dm.impl.Logger;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
@@ -87,7 +86,7 @@ public abstract class DependencyActivato
      */
     public void stop(BundleContext context) throws Exception {
         destroy(m_context, m_manager);
-        cleanup(m_manager);
+        m_manager.clear();
         m_manager = null;
         m_context = null;
     }
@@ -286,25 +285,8 @@ public abstract class DependencyActivato
      * 
      * @return the factory configuration adapter service
      */
-   public Component createFactoryConfigurationAdapterService(String factoryPid, String update,
boolean propagate, String heading, String desc, String localization, PropertyMetaData[] propertiesMetaData)
{
-       return m_manager.createFactoryConfigurationAdapterService(factoryPid, update, propagate,
heading, desc, localization, propertiesMetaData);
-   }
-
-    /**
-     * Cleans up all components and their dependencies.
-     * 
-     * @param manager the dependency manager
-     */
-    private void cleanup(DependencyManager manager) {
-        List services = manager.getComponents();
-        for (int i = services.size() - 1; i >= 0; i--) {
-            Component service = (Component) services.get(i);
-            manager.remove(service);
-            // remove any state listeners that are still registered
-            if (service instanceof ComponentImpl) {
-                ComponentImpl si = (ComponentImpl) service;
-                si.removeStateListeners();
-            }
-        }
+    public Component createFactoryConfigurationAdapterService(String factoryPid, String update,
boolean propagate, String heading, String desc, String localization, PropertyMetaData[] propertiesMetaData)
{
+        return m_manager.createFactoryConfigurationAdapterService(factoryPid, update, propagate,
heading, desc, localization, propertiesMetaData);
     }
+
 }

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java?rev=1202539&r1=1202538&r2=1202539&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/DependencyManager.java
Wed Nov 16 06:28:10 2011
@@ -551,4 +551,21 @@ public class DependencyManager {
     public List getComponents() {
         return Collections.unmodifiableList(m_components);
     }
+
+    /**
+     * Removes all components and their dependencies.
+     */
+    public void clear() {
+        List services = getComponents();
+        for (int i = services.size() - 1; i >= 0; i--) {
+            Component service = (Component) services.get(i);
+            remove(service);
+            // remove any state listeners that are still registered
+            if (service instanceof ComponentImpl) {
+                ComponentImpl si = (ComponentImpl) service;
+                si.removeStateListeners();
+            }
+        }
+    }
+    
 }



Mime
View raw message