/** * Remove the modules (that were previously registered by start()) from the reload monitor thread. * * <p>This method is invoked be WebContainer.stop() only when dynamic reloading has been enabled * in server.xml. */ public void stop() { ReloadMonitor reloadMonitor = ReloadMonitor.getInstance(1); for (int i = 0; i < _reloadables.size(); i++) { String id = (String) _reloadables.get(i); reloadMonitor.removeMonitoredEntry(id); } _reloadables.clear(); _reloadables = null; }
/** * Adds the given WebModule to the list of monitorable entries for dynamic reloading. * * @param wm The WebModule to add to the list of monitorable entries for dynamic reloading */ public void addWebModule(WebModule wm) { if (wm != null && isEnabled(wm.getConfigContext(), wm.getName())) { String name = wm.getName(); String id = name + "[" + _id + "]"; String fileName = getReloadFilename(wm); MonitorableEntry entry = new MonitorableEntry(id, name, new File(fileName), this); _reloadables.add(id); reloadMonitor.addMonitorableEntry(entry); } }
/** * Enable dynamic reloading (via the .reload file) for all the standalone web-modules that are * marked as enabled * * <p>This method is invoked be WebContainer.start() only when dynamic reloading has been enabled * in server.xml. */ public void start(long pollInterval) { reloadMonitor = ReloadMonitor.getInstance(pollInterval * 1000); }