JMX RMI相关

来源:互联网 发布:p衣服的软件 编辑:程序博客网 时间:2024/04/29 19:58

JMX trail: http://docs.oracle.com/javase/tutorial/jmx/index.html

Server (MBean --> Agent ) --> Client


JMX RMI example :

http://docs.oracle.com/javase/tutorial/jmx/remote/custom.html

其中,运行时需要指定参 数

java -Dcom.sun.management.jmxremote.port=9999 \     -Dcom.sun.management.jmxremote.authenticate=false \     -Dcom.sun.management.jmxremote.ssl=false \      com.example.Main

The port specified on the command line will be allocated by the JVM and an RMI registry will be available there.

(http://stackoverflow.com/questions/516142/does-java-6-open-a-default-port-for-jmx-remote-connections中的case2  )


导入eclipse,需要在代码中实现该步骤。

eg. java.rmi.registry.LocateRegistry.createRegistry(1099);


具体例子中,server与client之间通过connector联系。

server端:创建JMXConnectorServer

client端:连接到server,JMXConnector


注:版本问题。

JDK1.5之后,JMX API被集合进,无需下载其他包。

RMI 资料:Introduction to Java RMI

                  http://docs.oracle.com/javase/tutorial/rmi/index.html

  RMI:   通过registry查询服务,server端stub file(生成接口类);并可动态加载client端的skeleton class(具体实现类)变化。




0 0