From deef53467d9f1361b30d787a1d0244d37e59615b Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 17 Aug 2016 21:28:04 +0200 Subject: [PATCH] Fixes #855 - JMXify MBeanContainer. --- .../src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java | 2 ++ .../java/org/eclipse/jetty/util/component/Destroyable.java | 4 ++++ 2 files changed, 6 insertions(+) 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 9bcfe62f6f2..9c0382f998d 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 @@ -30,6 +30,7 @@ import javax.management.MBeanRegistrationException; import javax.management.MBeanServer; import javax.management.ObjectName; +import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.component.Container; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Destroyable; @@ -40,6 +41,7 @@ import org.eclipse.jetty.util.log.Logger; /** * Container class for the MBean instances */ +@ManagedObject("The component that registers beans as MBeans") public class MBeanContainer implements Container.InheritedListener, Dumpable, Destroyable { private final static Logger LOG = Log.getLogger(MBeanContainer.class.getName()); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Destroyable.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Destroyable.java index 8a7730f2f67..262411a183d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/Destroyable.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/Destroyable.java @@ -18,6 +18,8 @@ package org.eclipse.jetty.util.component; +import org.eclipse.jetty.util.annotation.ManagedObject; +import org.eclipse.jetty.util.annotation.ManagedOperation; /** *

A Destroyable is an object which can be destroyed.

@@ -25,7 +27,9 @@ package org.eclipse.jetty.util.component; * resources over multiple start/stop cycles. A call to destroy will release all * resources and will prevent any further start/stop cycles from being successful.

*/ +@ManagedObject public interface Destroyable { + @ManagedOperation(value = "Destroys this component", impact = "ACTION") void destroy(); }