Accessing Standard and Dynamic MBeans via the RMI Connector
来源:互联网 发布:logic pro windows版 编辑:程序博客网 时间:2024/05/20 06:37
The purpose of this examples is to demostrate the implementation of a standard MBean and a dynamic MBean. It also shows how to perform operations on them, both locally, and remotely through an RMI connection between a server and a remote client.
A standard MBean is one that statically defines its management interface through the name of the methods it contains. A dynamic MBean implements a specific java interface and reveals its attributes and opterations at run time.
The JMX technology defines a connector base on RMI. The RMI connector supports the standard RMI transports, Java Remote Method Protocol(JRMP) and the Internet Inter-Lbject Request Broker(ORB) Protocol(IIOP). This connector allows you to connect to an MBean server from a remote location, and perform operations on it, exactly as if the operations were being performed locally.
due to its size, the Server.java class is shown in several code excerpts.
public static void main(String[] args) {
try {
// Firstly, the Server.java class creates a new MBean server called mbs by calling the
// createMBeanServer() method of the MBeanServerFactory class.
MBeanServer mbs = MBeanServerFactory.createMBeanServer();
waitForEnterPressed();
// Then, the default domain in which the MBean server is registered is obtained with a call to the
// getDefaultDomain() method of the MBeanServer interface. The domain is identified by the the string domain .
String domain = mbs.getDefaultDomain();
waitForEnterPressed();
// The MBean class named SimpleStandard is also identified by a variable mbeanClassName .
// SimpleStandard is the name of java class for the java object of which this MBean is an instance.
String mbeanClassName = "SimpleStandard";
String mbeanObjectNameStr =
domain + ":type=" + mbeanClassName + ",name=1";
ObjectName mbeanObjectName =
createSimpleMBean(mbs, mbeanClassName, mbeanObjectNameStr);
waitForEnterPressed();
printMBeanInfo(mbs, mbeanObjectName, mbeanClassName);
waitForEnterPressed();
manageSimpleMBean(mbs, mbeanObjectName, mbeanClassName);
waitForEnterPressed();
mbeanClassName = "SimpleDynamic";
mbeanObjectNameStr =
domain + ":type=" + mbeanClassName + ",name=1";
mbeanObjectName =
createSimpleMBean(mbs, mbeanClassName, mbeanObjectNameStr);
waitForEnterPressed();
printMBeanInfo(mbs, mbeanObjectName, mbeanClassName);
waitForEnterPressed();
manageSimpleMBean(mbs, mbeanObjectName, mbeanClassName);
waitForEnterPressed();
[...]
- Accessing Standard and Dynamic MBeans via the RMI Connector
- Accessing Standard and Dynamic MBeans via the RMI Connector
- Accessing Standard and Dynamic MBeans via the RMI Connector
- Accessing MBeans Through the Jini Service @ JDJ
- RMI, Dynamic Proxies, and the Evolution of Deployment
- Accessing SapDB via unixODBC
- Essentials of JMX API - Standard MBeans
- Accessing Excel Spreadsheets via C++
- Tips and tricks for the Java connector
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic
- 正则去除标签的问题
- oracle面试
- rep movsb 和 cld
- 听力练习
- 我为联通说几句
- Accessing Standard and Dynamic MBeans via the RMI Connector
- HTML表单(HTML Form)中get 和post 的区别
- 如何控制ASX文件歌曲列表的播放
- Discuz X1.5 下载了怎么使用
- nand flash和nor flash两大阵营比较
- python-04-01 文件夹与文件
- oracle DBA面试题
- HDU 1251 统计难题(Tire tree)
- 工作流模式详解之流程控制模式(1)——Sequence