Hello,
is it possible to get the name of the current domain in Glassfish v2?
I've got a code like:
MemoryMXBean bean = ManagementFactory.getMemoryMXBean();
if (bean != null) {
MemoryUsage usage = bean.getNonHeapMemoryUsage();
int current = (int) ((double) usage.getUsed() / usage.getMax() * 100);
ch.log( Level.INFO, "Memory usage : (non heap) " + usage + " -- "+current+"% (limit:"+THRESHOLD+"%)");
if (current > THRESHOLD) {
//send email
}
which would send us an email when the appserver is about to crash (PermGen space exception); but we've got 3 appserver running, so the domain name would be really usefull ... any idea?
Thanks