Spring ManagedAttribute出现在JMX控制台的“操作"选项卡中 [英] Spring ManagedAttribute appears in the Operations tab of the JMX console

查看:84
本文介绍了Spring ManagedAttribute出现在JMX控制台的“操作"选项卡中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的MBean使用Spring注释进行注释,如下所示:

My MBeans are annotated using Spring annotations as follows:

@ManagedAttribute(description = "returns the name")
    public String getName() {
        return name;
    }

现在,每当我打开JMX控制台(无论是VisualVM还是JConsole)时,都可以在属性"选项卡中看到我的bean的属性,但是我也可以在操作"选项卡中看到getName()方法.有什么方法只能在属性"标签中看到该属性(即从操作"标签中将其隐藏)?

Now, whenever I open a JMX Console (be it VisualVM or JConsole), I can see the attributes of my beans in the Attributes tab, but I can also see the getName() method exposed in the Operations tab. Is there a way in which I can only see the attribute in the Attribute tab (i.e. hide it from the Operations tab)?

推荐答案

如果您看到javax.management.modelmbean.ModelMBeanOperationInfo的描述符部分,则会看到有参数role=gettervisibility=4,应该以某种方式将其隐藏(取决于显示属性/操作的应用程序).

If you see the descriptor part of the javax.management.modelmbean.ModelMBeanOperationInfo, you'll see that there are parameters role=getter and visibility=4, which should (it depends on application that displays attributes/operations) be hidden somehow.

https://jira.spring.io/browse/SPR-4232 <下查看更多详细信息.

这篇关于Spring ManagedAttribute出现在JMX控制台的“操作"选项卡中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆