ConnectionRegistry registry = ConnectionRegistry.getInstance();
MBeanServerConnection con =
registry.getConnection(_serverName, _domainName);
ASMBeanDiscoveryService discoveryService =
ASMBeanDiscoveryServiceFactory.getInstance().
getASMBeanDiscoveryService(con);
Set asMBeans = discoveryService.discoverASMBeans(_serverName);
//Get the config mbean for Cluster from the DAS Server instance
//Ideally, we should instrument CMM object for Cluster on registration
//event from DAS. Somehow, we are not getting an event from DAS for
//Cluster mbean registration.
MBeanServerConnection dasConn;
try {
dasConn = registry.getConnection(Constants.ADMIN_SERVER_NAME, _domainName);
} catch (Exception e) {
dasConn = null;
Utils.log(Level.INFO, "Not able to get hold of DAS Connection. Not instrumenting Cluster objects");
}
if(dasConn != null) {
ASMBeanDiscoveryService dasDiscoveryService =
ASMBeanDiscoveryServiceFactory.getInstance().
getASMBeanDiscoveryService(dasConn);
asMBeans.addAll(dasDiscoveryService.discoverClusterMBeans());
}
return asMBeans;
}