public WebConfigResourceMonitor(ServletContext sc, Collection<URI> uris) { assert (uris != null); this.sc = sc; for (URI uri : uris) { if (monitors == null) { monitors = new ArrayList<Monitor>(uris.size()); } try { Monitor m = new Monitor(uri); monitors.add(m); } catch (IOException ioe) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.severe("Unable to setup resource monitor for " + uri.toString() + ". Resource will not be monitored for changes."); } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, ioe.toString(), ioe); } } } }
boolean hasBeenModified() throws IOException { long temp = getLastModified(); if (timestamp < temp) { timestamp = temp; if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "{0} changed!", uri.toURL().toExternalForm()); } return true; } return false; }
Monitor m = i.next(); try { if (m.hasBeenModified()) { if (!reloaded) { reloaded = true;
Monitor m = i.next(); try { if (m.hasBeenModified()) { if (!reloaded) { reloaded = true;
Monitor m = i.next(); try { if (m.hasBeenModified()) { if (!reloaded) { reloaded = true;
Monitor m = i.next(); try { if (m.hasBeenModified()) { if (!reloaded) { reloaded = true;
public WebConfigResourceMonitor(ServletContext sc, Collection<URI> uris) { assert (uris != null); this.sc = sc; for (URI uri : uris) { if (monitors == null) { monitors = new ArrayList<>(uris.size()); } try { Monitor m = new Monitor(uri); monitors.add(m); } catch (IOException ioe) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.severe("Unable to setup resource monitor for " + uri.toString() + ". Resource will not be monitored for changes."); } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, ioe.toString(), ioe); } } } }
public WebConfigResourceMonitor(ServletContext sc, Collection<URI> uris) { assert (uris != null); this.sc = sc; for (URI uri : uris) { if (monitors == null) { monitors = new ArrayList<>(uris.size()); } try { Monitor m = new Monitor(uri); monitors.add(m); } catch (IOException ioe) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.severe("Unable to setup resource monitor for " + uri.toString() + ". Resource will not be monitored for changes."); } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, ioe.toString(), ioe); } } } }
public WebConfigResourceMonitor(ServletContext sc, Collection<URI> uris) { assert (uris != null); this.sc = sc; for (URI uri : uris) { if (monitors == null) { monitors = new ArrayList<>(uris.size()); } try { Monitor m = new Monitor(uri); monitors.add(m); } catch (IOException ioe) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.severe("Unable to setup resource monitor for " + uri.toString() + ". Resource will not be monitored for changes."); } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, ioe.toString(), ioe); } } } }
/** * PENDING javadocs */ public void run() { assert (monitors != null); boolean reloaded = false; for (Monitor m : monitors) { if (m.hasBeenModified()) { if (!reloaded) { reloaded = true; } } } if (reloaded) { reload(sc); } }
boolean hasBeenModified() throws IOException { long temp = getLastModified(); if (timestamp < temp) { timestamp = temp; if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "{0} changed!", uri.toURL().toExternalForm()); } return true; } return false; }
Monitor(URI uri) throws IOException { this.uri = uri; this.timestamp = getLastModified(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "Monitoring {0} for modifications", uri.toURL().toExternalForm()); } }
boolean hasBeenModified() throws IOException { long temp = getLastModified(); if (timestamp < temp) { timestamp = temp; if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "{0} changed!", uri.toURL().toExternalForm()); } return true; } return false; }
Monitor(URI uri) throws IOException { this.uri = uri; this.timestamp = getLastModified(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "Monitoring {0} for modifications", uri.toURL().toExternalForm()); } }
Monitor(URI uri) throws IOException { this.uri = uri; this.timestamp = getLastModified(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "Monitoring {0} for modifications", uri.toURL().toExternalForm()); } }
boolean hasBeenModified() { long temp = getLastModified(); if (timestamp < temp) { timestamp = temp; if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "{0} changed!", url.toExternalForm()); } return true; } return false; }
boolean hasBeenModified() throws IOException { long temp = getLastModified(); if (timestamp < temp) { timestamp = temp; if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "{0} changed!", uri.toURL().toExternalForm()); } return true; } return false; }
Monitor(URL url) { this.url = url; this.timestamp = getLastModified(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "Monitoring {0} for modifications", url.toExternalForm()); } }
public WebConfigResourceMonitor(ServletContext sc, Collection<URL> urls) { assert (urls != null); this.sc = sc; for (URL url : urls) { if (monitors == null) { monitors = new ArrayList<Monitor>(urls.size()); } monitors.add(new Monitor(url)); } }
Monitor(URI uri) throws IOException { this.uri = uri; this.timestamp = getLastModified(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.log(Level.INFO, "Monitoring {0} for modifications", uri.toURL().toExternalForm()); } }