/** * Load configuration values from init params if possible */ private void loadInitParams() { ServletConfig config = getServletConfig(); String _propsFileName = config.getInitParameter("propsFileName"); if (null != _propsFileName) { this.propsFileName = _propsFileName; } String _registryHost = config.getInitParameter("registryHost"); if (null != _registryHost) { this.registryHost = _registryHost; } String regPortString = config.getInitParameter("registryPort"); if (null != regPortString) { setRegistryPort(regPortString); } }
loadInitParams(); Properties props = loadPropertiesFromFile();
/** * Load configuration values from config file if possible */ private Properties loadPropertiesFromFile() { Properties props = null; try { props = RemoteUtils.loadProps(propsFileName); if (props != null) { registryHost = props.getProperty("registry.host", registryHost); String portS = props.getProperty("registry.port", String.valueOf(registryPort)); setRegistryPort(portS); } } catch (IOException e) { log.error("Problem loading props.", e); } return props; }