use of org.apache.ofbiz.service.config.model.ServiceConfig in project ofbiz-framework by apache.
the class ServiceConfigUtil method getServiceConfig.
/**
* Returns the <code>ServiceConfig</code> instance.
* @throws GenericConfigException
*/
public static ServiceConfig getServiceConfig() throws GenericConfigException {
ServiceConfig instance = serviceConfigCache.get("instance");
if (instance == null) {
Element serviceConfigElement = getXmlDocument().getDocumentElement();
instance = ServiceConfig.create(serviceConfigElement);
serviceConfigCache.putIfAbsent("instance", instance);
instance = serviceConfigCache.get("instance");
for (ServiceConfigListener listener : configListeners) {
try {
listener.onServiceConfigChange(instance);
} catch (Exception e) {
Debug.logError(e, "Exception thrown while notifying listener " + listener + ": ", module);
}
}
}
return instance;
}
Aggregations