felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r922607 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
Date Sat, 13 Mar 2010 16:53:28 GMT
Author: fmeschbe
Date: Sat Mar 13 16:53:28 2010
New Revision: 922607

URL: http://svn.apache.org/viewvc?rev=922607&view=rev
Log:
FELIX-2199 Register newly extracted built-in ConfigurationPrinters with service registry and
OsgiManager
FELIX-2147 Ensure all OsgiManagerPlugin implementations are deactivated when the OsgiManager
servlet is destroyed

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java?rev=922607&r1=922606&r2=922607&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
Sat Mar 13 16:53:28 2010
@@ -18,6 +18,7 @@ package org.apache.felix.webconsole.inte
 
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Dictionary;
 import java.util.Enumeration;
@@ -25,6 +26,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.ResourceBundle;
@@ -135,6 +137,8 @@ public class OsgiManager extends Generic
             "org.apache.felix.webconsole.internal.misc.LicenseServlet",
             "org.apache.felix.webconsole.internal.misc.ConfigurationRender",
             "org.apache.felix.webconsole.internal.misc.ShellServlet",
+            "org.apache.felix.webconsole.internal.misc.SystemPropertiesPrinter",
+            "org.apache.felix.webconsole.internal.misc.ThreadPrinter",
             "org.apache.felix.webconsole.internal.obr.BundleRepositoryRender",
             "org.apache.felix.webconsole.internal.system.VMStatPlugin"
         };
@@ -155,6 +159,10 @@ public class OsgiManager extends Generic
     // AbstractWebConsolePlugin instances
     private Map plugins = new HashMap();
 
+    // list of OsgiManagerPlugin instances activated during init. All these
+    // instances will have to be deactivated during destroy
+    private List osgiManagerPlugins = new ArrayList();
+
     private AbstractWebConsolePlugin defaultPlugin;
 
     private String defaultRenderName;
@@ -255,6 +263,7 @@ public class OsgiManager extends Generic
                 if ( plugin instanceof OsgiManagerPlugin )
                 {
                     ( ( OsgiManagerPlugin ) plugin ).activate( bundleContext );
+                    osgiManagerPlugins.add( plugin );
                 }
                 if ( plugin instanceof AbstractWebConsolePlugin )
                 {
@@ -384,7 +393,7 @@ public class OsgiManager extends Generic
         }
 
         // deactivate any remaining plugins
-        for ( Iterator pi = plugins.values().iterator(); pi.hasNext(); )
+        for ( Iterator pi = osgiManagerPlugins.iterator(); pi.hasNext(); )
         {
             Object plugin = pi.next();
             if ( plugin instanceof OsgiManagerPlugin )
@@ -395,6 +404,7 @@ public class OsgiManager extends Generic
 
         // simply remove all operations, we should not be used anymore
         this.plugins.clear();
+        this.osgiManagerPlugins.clear();
     }
 
 



Mime
View raw message