Spring ManagedAttribute出现在JMX控制台的“操作"选项卡中 [英] Spring ManagedAttribute appears in the Operations tab of the JMX console
问题描述
我的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)?
推荐答案
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屋!