}
}
}
private Double getSessionMetric(String metricName) {
EmsConnection jmxConnection = getEmsConnection();
String servletMBeanNames = QUERY_TEMPLATE_SESSION;
Configuration config = getResourceContext().getPluginConfiguration();
servletMBeanNames = servletMBeanNames.replace("%PATH%", config.getSimpleValue(PROPERTY_CONTEXT_ROOT, ""));
servletMBeanNames = servletMBeanNames.replace("%HOST%", config.getSimpleValue(PROPERTY_VHOST, ""));
ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(servletMBeanNames);
List<EmsBean> mBeans = jmxConnection.queryBeans(queryUtility.getTranslatedQuery());
String property = metricName.substring(METRIC_PREFIX_SESSION.length());
Double ret = Double.NaN;
if (mBeans.size() > 0) { // TODO flag error if != 1 ?
EmsBean eBean = mBeans.get(0);