use of com.sun.messaging.jmq.jmsserver.util.LoggerManager in project openmq by eclipse-ee4j.
the class CommGlobals method getConfig.
// ------------------------------------------------------------------------
// -- static methods for the singleton pattern --
// ------------------------------------------------------------------------
/**
* method to return the singleton config class
*/
public static BrokerConfig getConfig() {
if (config == null) {
synchronized (lock) {
if (config == null) {
try {
config = new BrokerConfig(configName, parameters, clearProps, saveProps);
} catch (BrokerException ex) {
getLogger().logStack(Logger.ERROR, "Internal Error: Unable to load broker, configuration properties are not available. Exiting", ex.getCause());
getCommBroker().exit(-1, "Internal Error: Unable to load broker," + " configuration properties are not available. Exiting", BrokerEvent.Type.FATAL_ERROR);
}
// now handle parameters
if (parameters != null) {
// set any non-jmq properties as system properties
Enumeration en = parameters.propertyNames();
Properties sysprops = System.getProperties();
while (en.hasMoreElements()) {
String name = (String) en.nextElement();
if (!name.startsWith(IMQ + ".")) {
sysprops.put(name, parameters.getProperty(name));
}
}
}
// First thing we do after reading in configuration
// is to initialize the Logger
Logger l = getLogger();
l.configure(config, IMQ, (getCommBroker() != null && getCommBroker().isInProcessBroker()), isJMSRAManagedSpecified(), (isNucleusManagedBroker() ? habitat : null));
// LoggerManager will register as a config listener
// to handle dynamic updates to logger properties
new LoggerManager(logger, config);
// l.open();
}
}
}
return config;
}
Aggregations