servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r486645 - /incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java
Date Wed, 13 Dec 2006 13:31:23 GMT
Author: gnodet
Date: Wed Dec 13 05:31:22 2006
New Revision: 486645

URL: http://svn.apache.org/viewvc?view=rev&rev=486645
Log:
Avoid NPE when component shuts down and the stats mbean is not registered

Modified:
    incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java?view=diff&rev=486645&r1=486644&r2=486645
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java
(original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/monitoring/StatisticsService.java
Wed Dec 13 05:31:22 2006
@@ -215,12 +215,15 @@
         ComponentMBeanImpl component = event.getComponent();
         String key = component.getName();
         ComponentStats stats = (ComponentStats) componentStats.remove(key);
+        if (stats == null) {
+            return;
+        }
         // Register MBean
         ManagementContext context= container.getManagementContext();
         try {
             context.unregisterMBean(context.createObjectName(context.createObjectNameProps(stats,
true)));
         } catch (Exception e) {
-            log.info("Unable to unregister component statistics MBean: " + e.getMessage());
+            log.info("Unable to unregister component statistics MBean: " + e);
             if (log.isDebugEnabled()) {
                 log.debug("Unable to unregister component statistics MBean", e);
             }



Mime
View raw message