if (objName != null) // MUST be 'volatile' for this test to work.
return objName;
synchronized( LogEvent.class ) {
try {
objName = new ObjectName( "amx:j2eeType=X-Logging,name="+
System.getProperty(SystemPropertyConstants.SERVER_NAME )+
",X-ServerRootMonitor=" +
System.getProperty(SystemPropertyConstants.SERVER_NAME ));
final MBeanServer mbeanServer = MBeanServerFactory.getMBeanServer();
if (mbeanServer.isRegistered(objName)) {
return objName;
} else
_logger.log(Level.WARNING,"smgt.internal_error",
new Object[] {sm.getString("selfmgmt_event.log_mbean_is_not_available")});
}catch (MalformedObjectNameException mex) {
_logger.log(Level.WARNING,"smgt.internal_error", mex);
}
}
return objName;