/** * Tells whether the ConfigurationProvider should reload its configuration. This method should only be called * if ConfigurationManager.isReloadingConfigs() is true. * * @return true if the file has been changed since the last time we read it */ public boolean needsReload() { for (String url : loadedFileUrls) { if (fileManager.fileNeedsReloading(url)) { return true; } } return false; }
public boolean needsReload() { if (devMode && reload) { for (String url : loadedFileUrls) { if (fileManager.fileNeedsReloading(url)) { LOG.debug("File [{}] changed, configuration will be reloaded", url); return true; } } return false; } else { return false; } }
private List<ValidatorConfig> loadFile(String fileName, Class clazz, boolean checkFile) { List<ValidatorConfig> retList = Collections.emptyList(); URL fileUrl = ClassLoaderUtil.getResource(fileName, clazz); if ((checkFile && fileManager.fileNeedsReloading(fileUrl)) || !validatorFileCache.containsKey(fileName)) { InputStream is = null; try { is = fileManager.loadFile(fileUrl); if (is != null) { retList = new ArrayList<ValidatorConfig>(validatorFileParser.parseActionValidatorConfigs(validatorFactory, is, fileName)); } } finally { if (is != null) { try { is.close(); } catch (IOException e) { LOG.error("Unable to close input stream for " + fileName, e); } } } validatorFileCache.put(fileName, retList); } else { retList = validatorFileCache.get(fileName); } return retList; } }
private Map<String, Object> conditionalReload(Class clazz, Map<String, Object> oldValues) throws Exception { Map<String, Object> mapping = oldValues; if (reloadingConfigs) { URL fileUrl = ClassLoaderUtil.getResource(buildConverterFilename(clazz), clazz); if (fileManager.fileNeedsReloading(fileUrl)) { mapping = buildConverterMapping(clazz); } } return mapping; }
if ((checkFile && fileManager.fileNeedsReloading(fileUrl)) || !validatorFileCache.containsKey(fileName)) { InputStream is = null;