Fixes #851 - MBeanContainer no longer unregisters MBeans when "stopped".

MBeanContainer now implements Destroyable, so calling Server.destroy()
unregisters the MBeans.
This commit is contained in:
Greg Wilkins 2016-08-18 15:58:25 +10:00
parent 526d1415a4
commit 9c9da42129
1 changed files with 3 additions and 1 deletions

View File

@ -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<String, AtomicInteger> __unique = new ConcurrentHashMap<String, AtomicInteger>();
@ -268,6 +269,7 @@ public class MBeanContainer implements Container.InheritedListener, Dumpable
return ContainerLifeCycle.dump(this);
}
@Override
public void destroy()
{
for (ObjectName oname : _beans.values())