/**
* Returns MBeans server for the Pogamut Platform. All MBeans connected from
* the platform should be registered in this server. There is also default
* RMI connector for this server running on service:jmx:rmi:///jndi/rmi://localhost:9999/server
* @return
* @throws cz.cuni.amis.utils.exception.PogamutException
*/
@Override
public synchronized MBeanServer getMBeanServer() throws PogamutException {
try {
if (!registryCreated) {
if (log.isLoggable(Level.WARNING)) log.warning("Creating registry at " + getRMIPort() + " ...");
LocateRegistry.createRegistry(getRMIPort());
registryCreated = true;
}
if (mBeanServer == null) {
if (log.isLoggable(Level.WARNING)) log.warning("Starting MBean server.");
//start a RMI registry
mBeanServer = new PogamutMBeanServer();
// also create connector for this server, server without connector
// would be unreachable outside this JVM
cs = JMXConnectorServerFactory.newJMXConnectorServer(getMBeanServerURL(), null, mBeanServer);
cs.start();
}
return mBeanServer;
} catch (Exception ex) {
throw new PogamutException("Error during JMX initialization.", ex);
}
}
DefaultPogamutPlatform.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:Pogamut3
作者:
评论列表
文章目录