From 9c9da42129ceca6334662cc783f952e0eaadf627 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 18 Aug 2016 15:58:25 +1000 Subject: [PATCH] Fixes #851 - MBeanContainer no longer unregisters MBeans when "stopped". MBeanContainer now implements Destroyable, so calling Server.destroy() unregisters the MBeans. --- .../src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java index 32fc5c53781..823dd5145ef 100644 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java +++ b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java @@ -34,6 +34,7 @@ import javax.management.ObjectName; import org.eclipse.jetty.util.component.Container; import org.eclipse.jetty.util.component.ContainerLifeCycle; +import org.eclipse.jetty.util.component.Destroyable; import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -41,7 +42,7 @@ import org.eclipse.jetty.util.log.Logger; /** * Container class for the MBean instances */ -public class MBeanContainer implements Container.InheritedListener, Dumpable +public class MBeanContainer implements Container.InheritedListener, Dumpable, Destroyable { private final static Logger LOG = Log.getLogger(MBeanContainer.class.getName()); private final static ConcurrentMap __unique = new ConcurrentHashMap(); @@ -268,6 +269,7 @@ public class MBeanContainer implements Container.InheritedListener, Dumpable return ContainerLifeCycle.dump(this); } + @Override public void destroy() { for (ObjectName oname : _beans.values())