public static void disconnectFromDS() throws Exception
{
try {
String[] domains = mbsc.getDomains();
String domain = null;
for (int i = 0; i < domains.length; i++) {
if (domains[i].equalsIgnoreCase(MBEAN_DOMAIN_GEMFIRE_NAME)) {
domain = domains[i];
break;
}
}
Set set = mbsc.queryNames(new ObjectName(domain + ":*"), null);
ObjectName on = null;
for (Iterator iter = set.iterator(); iter.hasNext();) {
on = (ObjectName)iter.next();
String onType = on.getKeyProperty(MBEAN_PROPERTY_BEAN_TYPE);
if (MBEAN_AGENT_TYPE.equalsIgnoreCase(onType))
break;
}
agent = on;
if (agent==null)
throw new ServiceNotFoundException( MBEAN_AGENT_TYPE +
" could not be contacted");
String[] params = {}, signature = {};
String method = "disconnectFromSystem";
ObjectName ret = null;
mbsc.invoke(agent, method, params, signature);
logger.info("DisConnected DS client");
}
catch (SecurityException secuEx) {
logger.error("Connection denied due to Security reasons", secuEx);
throw secuEx;
}
catch (InstanceNotFoundException instEx) {
logger.error("Did not find MBean Instance", instEx);
throw instEx;
}
catch (MBeanException beanEx) {
logger.error("Exception in MBean", beanEx.getCause());
throw beanEx;
}
catch (ReflectionException reflEx) {
logger.error("Could not get MBean Info", reflEx);
throw reflEx;
}
catch (IOException ioEx) {
logger.error("JMX Connection problem. Attempt opeartion Again", ioEx);
throw ioEx;
} finally {
//shLock.unlock();
}
}
JMXHelper.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:gemfirexd-oss
作者:
评论列表
文章目录