I want to expose my MXBeans on Apache-Tomcat 7.0. Though my MXBean registers successfully, I am unable to add description to the Operations that are exposed by thoese MXBeans.
Registering MXBeans
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName m_mxbeanOName = new ObjectName( "MyMXBean:type=" + "MyComponent"+",name=MyMXBean");
MyMXBean m_mxbean = new MyMXBean ();
if(!mbs.isRegistered(m_mxbeanOName))
mbs.registerMBean(m_mxbean, m_mxbeanOName);
MyMXBean Interface
public interface MyMXBean {
public int add (int x, int y);
}
MyMXBean Implementation
import com.sun.org.glassfish.gmbal.Description;
import com.sun.org.glassfish.gmbal.DescriptorFields;
import com.sun.org.glassfish.gmbal.Impact;
import com.sun.org.glassfish.gmbal.ManagedOperation;
public class MyMXBeanImpl implements MyMXBean {
@ManagedOperation(impact=Impact.ACTION_INFO)
@Description("Integer Addition: First parameter is the augend and second parameter is the addend.")
@DescriptorFields({"p1=augend","p2=addend"})
public int add(int x, int y) {
return x + y;
}
The annotation @ManagedOperation, @Description, @DescriptorFields has no effect on the jconsole. JConsole continues to show default values
Please tell me ways to show the description about my MXBean operations on JConsole.