/** * Reload the config from the default config file * * @exception java.io.IOException * Thrown if the specified config file cannot be read/loaded * @throws java.io.IOException if any. */ public static synchronized void reload() throws IOException { if (m_loadedFromFile) { setInstance(null); init(); } }
/** * Load the config from the default config file and create the singleton * instance of this factory. * * @exception java.io.IOException * Thrown if the specified config file cannot be read * @throws java.io.IOException if any. */ public static synchronized void init() throws IOException { if (m_singleton != null) { /* * The init method has already called, so return. * To reload, reload() will need to be called. */ return; } InputStream is = null; try { is = new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.VACUUMD_CONFIG_FILE_NAME)); setInstance(new VacuumdConfigFactory(is)); } finally { if (is != null) { IOUtils.closeQuietly(is); } } m_loadedFromFile = true; }