}
private Double getSessionMetric(String metricName) {
boolean isClustered = false;
EmsConnection jmxConnection = getEmsConnection();
String servletMBeanNames = SESSION_NAME_BASE_TEMPLATE.replace("%PATH%",
WarDiscoveryHelper.getContextPath(this.contextRoot));
servletMBeanNames = servletMBeanNames.replace("%HOST%", vhost);
ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(servletMBeanNames);
List<EmsBean> mBeans = jmxConnection.queryBeans(queryUtility.getTranslatedQuery());
if (mBeans.size() == 0) {
// retry with the cluster manager TODO select the local vs cluster mode on discovery
servletMBeanNames = CLUSTER_SESSION_NAME_BASE_TEMPLATE.replace("%PATH%",
WarDiscoveryHelper.getContextPath(this.contextRoot));
servletMBeanNames = servletMBeanNames.replace("%HOST%", vhost);
queryUtility = new ObjectNameQueryUtility(servletMBeanNames);
mBeans = jmxConnection.queryBeans(queryUtility.getTranslatedQuery());
if (mBeans.size() > 0)
isClustered = true;
}
String property = metricName.substring(SESSION_PREFIX.length());