public synchronized boolean reload(boolean force) { long now = System.currentTimeMillis(); if (force == false && now < last_check + 3000) return false; last_check = now; File file = getPropertyFile(); if (file.lastModified() == last_load_time) { return false; } last_load_time = file.lastModified(); Properties temp = new Properties(); if (file.canRead()) { FileInputStream in = null; try { in = new FileInputStream(file); temp.load(in); } catch (Exception e) { e.printStackTrace(); } finally { FileUtil.close(in); } } property = ConfigValueUtil.replaceSysProp(temp); apply(); ConfObserver.run(); return true; }
static { deltas.add(CounterConstants.REQUESTPROCESS_BYTES_RECEIVED); deltas.add(CounterConstants.REQUESTPROCESS_BYTES_SENT); deltas.add(CounterConstants.REQUESTPROCESS_ERROR_COUNT); deltas.add(CounterConstants.REQUESTPROCESS_PROCESSING_TIME); deltas.add(CounterConstants.REQUESTPROCESS_REQUEST_COUNT); ConfObserver.add( "TomcatJMXPerf", new Runnable() { public void run() { ObjTypeDetector.dirtyConfig = true; } }); }