# JMX简介

• JMX是干什么的？为什么有JMX？
• JMX怎么用？
• Jconsole怎么配合？
• 怎么与Jmxtrans配合？（本质就是使用Jmxtrans的作用，如何安装、使用）

## JMX是做什么的？

The JMX technology provides the tools for building distributed, Web-based, modular and dynamic solutions for managing and monitoring devices, applications, and service-driven networks. By design, this standard is suitable for adapting legacy systems, implementing new management and monitoring solutions, and plugging into those of the future.

Starting with the J2SE platform 5.0, JMX technology is included in the Java SE platform. Please see the JMX documentation for the J2SE 5.0 and Java SE 6 platforms.

notes(ningg)：JMX（Java Management eXtensions）用于监控系统运行状态。

## JMX怎么用？

JMX（Java Management eXtensions），涉及几个术语：

• MBeans：
• ObjectName：MBean name，或者是a pattern（用于匹配多个MBean name）；
• JMX agent：其中包含JMX connector；
• Remote Management：

### ObjectName

domain: key-property-list


For example:

com.sun.someapp:type=Whatsit,name=25


• 空格是有含义的：Spaces are significant everywhere in an Object Name. Do not write type=Thread, name=DGC (with a space after the comma) because it will be interpreted as having a key called “ name”, with a leading space in the name.
• 大小写敏感的：Object Names are case sensitive.
• properties顺序无关性：The order of key properties is not significant.
• key命名约束：The set of characters in a key is limited. It is recommended to stick to legal Java identifiers.
• value是否使用引号：The set of characters in a value is also limited. If special characters may occur, it is recommended that the value be quoted, using ObjectName.quote.

In a pattern, the key-property-list can have the same form as just described; or it can be a single *; or it can be empty (equivalent to a *); or it can be a list followed by ,*. These forms match Object Names that have the exact key properties given (if any) plus any arbitrary other key properties. For example, *:type=Thread,* matches somedomain:type=Thread and somedomain:type=Thread,name=DGC.

## JMX基本原理

JMX的基本原理，基本框架图，有没有？这个让我费了一番精力，最后发现JMX的官方specification中有最权威的插图，言简意赅、深入浅出，看来今后也要关注官网的Specification。

JMX 1.2 specification：http://jcp.org/en/jsr/detail?id=003

JMX agent的作用是什么？其与JMX有什么关系？

Top