Questions on JMX Example

删除回忆录丶 提交于 2019-12-06 09:32:26
spidey

Your CompositeData will have a method to return its CompositeType. The type defines the attribute names (keys) of your CompositeData. JConsole, and other JMX clients, may use these keys to access data from the CompositeData.

It is perhaps too late to answer this question - however I wanted to take a shot at this given that I am currently studying JMX.

Questions answered :

  1. Yes, the posted code looks to me to be the correct way to write MBeans within an application.
  2. It is recommended to have custom defined MBeans to manage the resources exposed by an application. What resources warrant management is usually a design-time decision. However, from what I understand; we would want to manage resources that would have impact on the performance and stability of the system and hence would want to administer. A good example would be the Apache Solr related classes which implement the SoltInfoMBean management interface, so that these objects can be managed from the Solr Administration console.
  3. While you can have your own custom implementation to track individual components of the system, the advantage of using MBeans to perform the tracking is not limited to jConsole** UI support alone. With the use of standard JMX interfaces, you provide facilities like Out-of-the-box management capabilities with any management applications that confirms to the JMX spec. Also it would support management over various communication protocols such as RMI, SNMP etc without the management console and the managed applications worry about the nitty-gritties of underlying protocol. This page provides a good set of reasons to use JMX interfaces to add monitoring capabilities to your application.

Hope this helps.

I didn't run the code but it looks fine, you can return any serializable object if the JMX client is Java and has access to the same serializable class, see this link

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!