EmsConnection connection = loadConnection();
EmsBean bean = connection.getBean("jboss.system:type=ServerConfig");
File serverHomeViaJnp;
EmsAttribute serverHomeDirAttrib = bean.getAttribute("ServerHomeDir");
if (serverHomeDirAttrib != null) {
serverHomeViaJnp = (File) serverHomeDirAttrib.refresh();
} else {
// We have a non-null MBean but a null ServerHomeDir attribute. This most likely means we're
// connected to a JBoss 5.x or 6.x instance, because in those versions the ServerConfig MBean no
// longer has a ServerHomeDir attribute. It instead has a ServerHomeLocation attribute, so give
// that a try, so getAvailabilityNow() can print a more intelligent warning.