java - Get the name of a Glassfish2 domain -


Is it possible to get the name of the current domain in glassfish v2?

I've got a code like this:

MemoryMXBean Bean = ManagementFactory.getMemoryMXBean (); If (bean! = Null) {MemoryUsage use = bean.getNonHeapMemoryUsage (); Int current = (int) (double) use.getuasad () / ujation.metime () * 100); Ch.log (level .INFO, "Memory usage: (non-stack)" + + use + "-" + current + "% (range:" + THRESHOLD + "%)"); If (current> gt; THRESHOLD) {// send email}

that sends us an email when the application server is about to crash (PermGen location exception); But we have 3 apps running, so the domain name will really be useful ... any ideas?

Thanks

You can use to get the domain name. It is available from .getAppserverDomainName ().


Comments