private void loadConfiguration(String configurationFile) throws ConfigurationException {
//Properties from system properties
CompositeConfiguration compositeConfig = new CompositeConfiguration();
compositeConfig.addConfiguration(new SystemConfiguration());
//Properties from XML file
XMLConfiguration xmlConfig = null;
if (configurationFile!=null) {
xmlConfig = new XMLConfiguration(configurationFile);
} else {
final String filename = System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY);
if (filename != null) {
xmlConfig = new XMLConfiguration(filename);
} else {
xmlConfig = new XMLConfiguration(DEFAULT_UDDI_CONFIG);
}
}
log.info("Reading UDDI Client properties file " + xmlConfig.getBasePath());
long refreshDelay = xmlConfig.getLong(Property.UDDI_RELOAD_DELAY, 1000l);
log.debug("Setting refreshDelay to " + refreshDelay);
FileChangedReloadingStrategy fileChangedReloadingStrategy = new FileChangedReloadingStrategy();
fileChangedReloadingStrategy.setRefreshDelay(refreshDelay);
xmlConfig.setReloadingStrategy(fileChangedReloadingStrategy);
compositeConfig.addConfiguration(xmlConfig);
//Making the new configuration globally accessible.
config = compositeConfig;
loadManager();
}