Friday, October 10, 2008

JMX Remoting cited from http://whitesock.javaeye.com/blog/246186

ava Management Extension (JMX) API defined in JSR 3, for application management. 这些API对于被管理的应用程序来说是本地的。 API was for the management of these applications is local. 也就是说,在JSR 160发布之前,如果客户端要通过JMX来管理和监控远程的应用程序,并没有标准的做法。 In other words, JSR 160 prior to the release, if the client through JMX to manage and monitor the long-range applications, there is no standard practice. JSR 160扩展了JSR 3,提供了标准的API用于连接到支持JMX的远程应用程序。 JSR 160 extends the JSR 3, provides a standard API used to connect to the JMX support for the long-range applications. JSR 255将会把JMX升级到2.0,并可能体现在Java 7中。 JSR 255 will be JMX to upgrade to 2.0, and may be reflected in the Java 7.
目前JSR 160定义了基于RMI(支持RMI/JRMP 和RMI/IIOP)的连接器,还定义了可选的JMXMP连接器,它基于TCP Socket和Java序列化机制。 At present, the definition of JSR 160-based RMI (support for the RMI / JRMP and RMI / IIOP) connector, but also the definition of JMXMP optional connector, which is based on TCP Socket and Java serialization mechanism.

2 JMX Remoting API 2 JMX Remoting API
2.1 JMXServiceURL 2.1 JMXServiceURL
JMXServiceURL用于标识JMXConnectorServer,它是采用以下形式的字符串: JMXServiceURL used to identify JMXConnectorServer, it is a form of the following strings:
service:jmx:://[[[ ]: ]/ ] service: jmx: ://[[[ ]: ] / ]
"protocol" 指定了协议,例如:rmi、iiop、jmxmp 或者soap。 "protocol" agreement specifies, for example: rmi, iiop, jmxmp or soap. "host"、"port" 和"path"是可选的。 "host", "port" and "path" is optional. JMXServiceURL 并不足以描述所有的用于连接到JMXConnectorServer的配置信息(例如配置RMIClientSocketFactory 和RMIServerSocketFactory),因此在构造JMXConnectorServer 和JMXConnector的时候,还可能需要通过一个Map实例指定其它属性。 JMXServiceURL is not sufficient to describe all the JMXConnectorServer used to connect to the configuration information (such as configuration RMIClientSocketFactory and RMIServerSocketFactory), in JMXConnectorServer structure and JMXConnector, may also need a designated examples of other attributes Map.

2.2 JMXConnectorServer 2.2 JMXConnectorServer
JMXConnectorServer 是MBeanServer端的组件,它需要被关联到MBeanServer:可以通过在创建JMXConnectorServer的时候显式指定 MBeanServer;也可以把JMXConnectorServer(本身是一个MBean)注册到MBeanServer中。 JMXConnectorServer is MBeanServer side of the components it needs to be linked to the MBeanServer: through the creation of JMXConnectorServer time specified explicitly MBeanServer; can also JMXConnectorServer (itself a MBean) registered in the MBeanServer.
在被关联到MBeanServer之后,需要启动JMXConnectorServer以处理客户端的请求。 Being associated to the MBeanServer, JMXConnectorServer need to deal with the client's request. 同样,如果希望停止处理客户端的请求,那么需要停止JMXConnectorServer。 By the same token, if you want to stop dealing with the client's request, then the need to stop JMXConnectorServer. JMXConnectorServer被停止之后,不应该试图重新启动它,而是应该将其丢弃。 JMXConnectorServer be stopped, should not try to restart it, but should be discarded.
最好通过JMXConnectorServerFactory来创建JMXConnectorServer,例如: JMXConnectorServerFactory through to create the best JMXConnectorServer, such as:

No comments: