if(raMgrService == null){
try {
return raMgrService = (RemoteAccessManager)MBeanProxyExt.create(RemoteAccessManager.class, "mycomp:service=AccessCenter");
} catch (Exception e) {
log.error("Failed to find mycomp:service=AccessCenter", e);
}
}
return raMgrService;
mycomp:service=AccessCenter 是 jboss service mbean 服务名
<?xml version='1.0' encoding='UTF-8' ?>
<server>
<mbean code="com.jhalo.security.AccessCenterService"
name="jhalo:service=AccessCenter">
如果希望远程调用可以:
<attribute name="ExportInterfaces">com.jhalo.security.RemoteAccessManager</attribute>
export 实现类的接口.
方向:分布式系统设计