MBeanServer mbs = MBeanServerFactory.getMBeanServer();
ObjectName serversON = new ObjectName(getDomainName() + ":type=servers,category=config");
ObjectName[] serverONArr = (ObjectName[]) mbs.invoke(serversON, "getServer", new Object[]{}, new String[]{});
mInstanceName = (String) mbs.getAttribute(serverONArr[0], "name");
} catch (Exception e) {
throw new DeploymentException("Could not obtain instanceName");
}
}
return mInstanceName;
}