/** * Stop monitoring. * * @throws Exception if an error occurs initializing the observer */ public synchronized void stop() throws Exception { stop(interval); }
public void destroy() { try { fileMonitor.stop(); } catch (Exception e) { logger.error(e.getMessage(), e); } }
public void destroy() { try { fileMonitor.stop(); } catch (Exception e) { logger.error(e.getMessage(), e); } }
public void destroy() { try { fileMonitor.stop(); } catch (Exception e) { logger.error(e.getMessage(), e); } }
@PreDestroy public void destroy() { try { fileMonitor.stop(); } catch (Exception e) { logger.error(e.getMessage(), e); } }
/** * Test using a thread factory. * @throws Exception */ @Test public void testThreadFactory() throws Exception { final long interval = 100; listener.clear(); final FileAlterationMonitor monitor = new FileAlterationMonitor(interval, observer); monitor.setThreadFactory(Executors.defaultThreadFactory()); assertEquals("Interval", interval, monitor.getInterval()); monitor.start(); // Create a File checkCollectionsEmpty("A"); final File file2 = touch(new File(testDir, "file2.java")); checkFile("Create", file2, listener.getCreatedFiles()); listener.clear(); // Delete a file checkCollectionsEmpty("B"); file2.delete(); checkFile("Delete", file2, listener.getDeletedFiles()); listener.clear(); // Stop monitoring monitor.stop(); }
/** * Stop monitoring. * * @throws Exception if an error occurs initializing the observer */ public synchronized void stop() throws Exception { stop(interval); }
public void stop(long ms) throws Exception { if (isRunning) { monitor.stop(ms); isRunning = false; } }
/** * Stop monitoring. * * @throws Exception if an error occurs initializing the observer */ public synchronized void stop() throws Exception { stop(interval); }
/** * Stop monitoring. * * @throws Exception if an error occurs initializing the observer */ public synchronized void stop() throws Exception { stop(interval); }
public synchronized void stop() { if (!running) return; running = false; if (monitor != null) try { monitor.stop(); } catch (Exception e) { log.error("stop monitor fail", e); } }
private void stopMonitor() throws MojoExecutionException { if (monitors != null) { for (final FileAlterationMonitor monitor : monitors) { try { monitor.stop(); } catch (Exception e) { throw new MojoExecutionException(e.getMessage(), e); } } } }
/** * Shuts down the pipeline. This methods stops the FAM. */ public void shutdown() { try { watcher.stop(); } catch (Exception e) { //NOSONAR mojo.getLog().debug("Something went terribly wrong when we try to stopped the FAM of the pipeline", e); // ignore it. } }
void stop() { logger.trace("Stopping TorrentFileProvider."); this.observer.getListeners().forEach(observer::removeListener); try { this.monitor.stop(10); } catch (final Exception ignored) { } logger.trace("TorrentFileProvider stopped."); }
public static void stopMonitor(ActionContext actionContext) throws Exception{ FileAlterationMonitor monitor = (FileAlterationMonitor) actionContext.get("object"); if(monitor != null){ monitor.stop(); } }
@PreDestroy public void shutdown() { try { _scheduler.shutdown(); } catch (SchedulerException e) { logger.error("Failed to shutdown scheduler: " + e.getMessage(), e); } try { _hotFolderMonitor.stop(); } catch (Exception e) { logger.error("Failed to shutdown file alteration monitor: " + e.getMessage(), e); } }
@Override public void stopMonitor() throws Exception { // Stop the local configuration monitors for (FileAlterationMonitor monitor : monitors) { monitor.stop(); } // Stop the remote configuration monitor, if it has been initialized if (remoteMonitor != null) { remoteMonitor.stop(); } }
public FileMonitor() { MercuryStoreCore.poeFolderChangedSubject.subscribe(state -> { if (monitor != null) { try { monitor.stop(); } catch (Exception e) { logger.error("Error in FileMonitor: ", e); } start(); } }); }
public static void stop(ActionContext actionContext) throws Exception{ Thing self = actionContext.getObject("self"); FileAlterationMonitor monitor = (FileAlterationMonitor) self.doAction("getMonitor", actionContext); if(monitor != null){ monitor.stop(); } }