/** * Stop monitoring. * * @param stopInterval the amount of time in milliseconds to wait for the thread to finish. * A value of zero will wait until the thread is finished (see {@link Thread#join(long)}). * @throws Exception if an error occurs initializing the observer * @since 2.1 */ public synchronized void stop(final long stopInterval) throws Exception { if (running == false) { throw new IllegalStateException("Monitor is not running"); } running = false; try { thread.join(stopInterval); } catch (final InterruptedException e) { Thread.currentThread().interrupt(); } for (final FileAlterationObserver observer : observers) { observer.destroy(); } }
@Override public void destroy() { result = null; try { fileAlterationObserver.destroy(); } catch (Exception e) { } }
public synchronized void stop(long stopInterval) throws Exception { if (running == false) { throw new IllegalStateException("Monitor is not running"); } running = false; try { thread.join(stopInterval); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } /***** Observers are destroyed here ****/ for (FileAlterationObserver observer : observers) { observer.destroy(); } }
void removeHotFolder(String jobIdentifier) { final FileAlterationObserver observer = _registeredHotFolders.get(jobIdentifier); _hotFolderMonitor.removeObserver(observer); try { observer.destroy(); } catch (Exception e) { logger.info("Removing hot folder trigger for job {}", jobIdentifier); } }
/** * Stop monitoring. * * @param stopInterval the amount of time in milliseconds to wait for the thread to finish. * A value of zero will wait until the thread is finished (see {@link Thread#join(long)}). * @throws Exception if an error occurs initializing the observer * @since 2.1 */ public synchronized void stop(long stopInterval) throws Exception { if (running == false) { throw new IllegalStateException("Monitor is not running"); } running = false; try { thread.join(stopInterval); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } for (FileAlterationObserver observer : observers) { observer.destroy(); } }
/** * Stop monitoring. * * @param stopInterval the amount of time in milliseconds to wait for the thread to finish. * A value of zero will wait until the thread is finished (see {@link Thread#join(long)}). * @throws Exception if an error occurs initializing the observer * @since 2.1 */ public synchronized void stop(long stopInterval) throws Exception { if (running == false) { throw new IllegalStateException("Monitor is not running"); } running = false; try { thread.join(stopInterval); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } for (FileAlterationObserver observer : observers) { observer.destroy(); } }
/** * Stop monitoring. * * @param stopInterval the amount of time in milliseconds to wait for the thread to finish. * A value of zero will wait until the thread is finished (see {@link Thread#join(long)}). * @throws Exception if an error occurs initializing the observer * @since 2.1 */ public synchronized void stop(final long stopInterval) throws Exception { if (running == false) { throw new IllegalStateException("Monitor is not running"); } running = false; try { thread.join(stopInterval); } catch (final InterruptedException e) { Thread.currentThread().interrupt(); } for (final FileAlterationObserver observer : observers) { observer.destroy(); } }
/** * Stop monitoring. * * @param stopInterval the amount of time in milliseconds to wait for the thread to finish. * A value of zero will wait until the thread is finished (see {@link Thread#join(long)}). * @throws Exception if an error occurs initializing the observer * @since 2.1 */ public synchronized void stop(final long stopInterval) throws Exception { if (running == false) { throw new IllegalStateException("Monitor is not running"); } running = false; try { thread.join(stopInterval); } catch (final InterruptedException e) { Thread.currentThread().interrupt(); } for (final FileAlterationObserver observer : observers) { observer.destroy(); } }