spring整合jmx,之前搜到一些,都有点复杂,给个简单易懂的给你们,Jmx,Java Management Extension
使用方法,是全注解的
spring配置文件添加
<context:mbean-export default-domain="airsoft" registration="replaceExisting" />
@Component
@ManagedResource(objectName = "airsoft:name=Test", description = "证照设置")
public class TestMBean {
private boolean test= true;
@ManagedAttribute(description = "是否把证照管理员也给加入到查看人员中去")
public boolean isTest() {
return addAdmin;
}
}