package com;
import java.io.File;
import java.io.IOException;
import java.rmi.RMISecurityManager;
import java.rmi.registry.LocateRegistry;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;
import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.JMXServiceURL;
public class Server {
private static MBeanServer server;
private static int PORT = 10022;
private static final String DOMAIN = "linpeiwen";
public static void init() throws Exception {
server = MBeanServerFactory.createMBeanServer(DOMAIN);
// server = ManagementFactory.getPlatformMBeanServer();
server.registerMBean(new SimpleStandard(), new ObjectName(DOMAIN + ":name=standard"));
initialize();
JMXServiceURL serviceURL = new JMXServiceURL(
"service:jmx:rmi://localhost/jndi/rmi://localhost:" + PORT
+ "/" + DOMAIN);
JMXConnectorServer connectorServer = JMXConnectorServerFactory
.newJMXConnectorServer(serviceURL, null, server);
server.registerMBean(connectorServer, new ObjectName(
"connector:name=rmi"));
connectorServer.start();
System.out.print("startup....");
}
private static void initialize() throws IOException {
// URL serverPolicyFileName = new URL("server.policy"); //$NON-NLS-1$
// (serverPolicyBundleURL);
// URL serverPolicyBundleURL =
// FileLocator.toFileURL(serverPolicyFileName);
System
.setProperty(
"java.security.policy", "D:/workspace/jxmdemo/src/com/server.policy"); //$NON-NLS-1$
LocateRegistry.createRegistry(PORT);
System.setSecurityManager(new RMISecurityManager());
}
public static void main(String[] args) {
try {
init();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
jmx 实例 rmi mbean
共50个文件
jar:35个
java:4个
class:4个
4星 · 超过85%的资源 需积分: 10 23 下载量 84 浏览量
2009-05-21
09:54:30
上传
评论
收藏 5.96MB RAR 举报
温馨提示
jmx 实例 rmi mbean,采用rmi方式进行jmx的mbean管理,通过这个实例能够了解jmx的应用
资源推荐
资源详情
资源评论
收起资源包目录
jxmdemo.rar (50个子文件)
jxmdemo
.project 1009B
.mymetadata 294B
WebRoot
WEB-INF
web.xml 286B
lib
classes
com
SimpleStandardMBean.class 269B
server.policy 50B
Client.class 3KB
Server.class 3KB
SimpleStandard.class 1KB
META-INF
MANIFEST.MF 39B
lib
log4j-1.2.12.jar 350KB
org.eclipse.equinox.http.registry_1.0.100.v20080427-0830.jar 35KB
geronimo-core-1.1.jar 40KB
javax.servlet_2.4.0.v200806031604.jar 105KB
org.eclipse.core.runtime.compatibility.auth_3.2.100.v20070502.jar 21KB
activemq-ra-4.0.2.jar 70KB
geronimo-activation_1.0.2_spec-1.1.jar 33KB
spring-2.0-rc3.jar 2.38MB
org.eclipse.equinox.registry_3.4.0.v20080516-0950.jar 169KB
geronimo-servlet_2.4_spec-1.0.1.jar 81KB
org.eclipse.core.contenttype_3.3.0.v20080604-1400.jar 85KB
org.eclipse.osgi.services_3.1.200.v20071203.jar 62KB
org.eclipse.equinox.log_1.1.0.v20080414.jar 25KB
activeio-core-3.0-beta4.jar 229KB
geronimo-javamail_1.3.1_spec-1.1.jar 176KB
org.eclipse.equinox.http_1.0.200.v20080421-2006.jar 91KB
commons-logging-1.0.4.jar 37KB
geronimo-ejb_2.1_spec-1.0.1.jar 19KB
activemq-core-4.0.2.jar 1.28MB
geronimo-j2ee-connector_1.5_spec-1.0.jar 32KB
org.eclipse.core.jobs_3.4.0.v20080512.jar 81KB
lingo-1.3.jar 112KB
geronimo-jta_1.0.1B_spec-1.0.1.jar 14KB
geronimo-transaction-1.1.jar 74KB
geronimo-connector-1.1.jar 132KB
org.eclipse.equinox.app_1.1.0.v20080421-2006.jar 78KB
org.eclipse.core.runtime_3.4.0.v20080512.jar 67KB
org.eclipse.equinox.common_3.4.0.v20080421-2006.jar 92KB
backport-util-concurrent-2.1.jar 322KB
geronimo-j2ee-management_1.0_spec-1.0.1.jar 19KB
geronimo-j2ee-jacc_1.0_spec-1.0.1.jar 30KB
geronimo-jms_1.1_spec-1.0.1.jar 31KB
org.eclipse.equinox.preferences_3.2.201.R34x_v20080709.jar 102KB
geronimo-system-1.1.jar 268KB
org.eclipse.equinox.ds_1.0.0.v20080427-0830.jar 137KB
.myeclipse
src
com
Server.java 2KB
server.policy 50B
SimpleStandardMBean.java 190B
SimpleStandard.java 521B
Client.java 1KB
.classpath 3KB
共 50 条
- 1
资源评论
- macro_lu2014-06-13讲的的挺好的 但是不太好用
peiwenlin
- 粉丝: 3
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Python的pyqt5写的图书管理系统期末大作业源码带文档设计.zip
- pcff_interface_v1_5.off
- apk.tw_LineLite_v8a_v.2.17.1_sign.apk
- Elasticsearch实战:构建高效搜索系统的秘诀.zip
- HTML+CSS+JS网页设计:从入门到精通.zip
- 数据库课程设计:从理论到实践的全面指南.zip
- Python闭包:深入理解与应用场景解析.zip
- Win64OpenSSL-3-3-0.exe
- 课高分程设计-基于C++实现的民航飞行与地图简易管理系统-南京航空航天大学
- 航天器遥测数据故障检测系统python源码+文档说明+数据库(课程设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功