felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvalc...@apache.org
Subject svn commit: r1027104 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/PluginHolder.java
Date Mon, 25 Oct 2010 13:16:34 GMT
Author: vvalchev
Date: Mon Oct 25 13:16:34 2010
New Revision: 1027104

URL: http://svn.apache.org/viewvc?rev=1027104&view=rev
Log:
Fixed FELIX-2674 /Too much error logging after fixing FELIX-2644/
https://issues.apache.org/jira/browse/FELIX-2674

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

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/PluginHolder.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/PluginHolder.java?rev=1027104&r1=1027103&r2=1027104&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/PluginHolder.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/PluginHolder.java
Mon Oct 25 13:16:34 2010
@@ -728,6 +728,7 @@ class PluginHolder implements ServiceLis
         final String pluginClassName;
         final OsgiManager osgiManager;
         AbstractWebConsolePlugin plugin;
+        boolean doLog = true;
 
         protected InternalPlugin(PluginHolder holder, OsgiManager osgiManager, String pluginClassName,
String label)
         {
@@ -746,7 +747,11 @@ class PluginHolder implements ServiceLis
             if (null == plugin) {
                 if (!isEnabled()) 
                 {
-                    osgiManager.log( LogService.LOG_INFO, "Ignoring plugin " + pluginClassName
+ ": Disabled by configuration" );
+                    if (doLog)
+                    {
+                        osgiManager.log( LogService.LOG_INFO, "Ignoring plugin " + pluginClassName
+ ": Disabled by configuration" );
+                        doLog = false;
+                    }
                     return null;
                 }
 
@@ -759,11 +764,16 @@ class PluginHolder implements ServiceLis
                     {
                         ((OsgiManagerPlugin) plugin).activate(getBundle().getBundleContext());
                     }
-
+                    doLog = true; // reset logging if it succeeded
                 }
                 catch (Throwable t)
                 {
-                    osgiManager.log( LogService.LOG_WARNING, "Failed to instantiate plugin
" + pluginClassName, t );
+                    plugin = null; // in case only activate has faled!
+                    if (doLog)
+                    {
+                        osgiManager.log( LogService.LOG_WARNING, "Failed to instantiate plugin
" + pluginClassName, t );
+                        doLog = false;
+                    }
                 }
             }
 



Mime
View raw message