/** * If this is the last time calling stop, then stop the change services. * @param name the name to keep track of */ public static synchronized void stop(final String name) { _names.remove(name); if (_names.size() == 0 && _running) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Stopping resource change service..."); } // ORDER IS IMPORTANT! // 1) stop the scanner ResourceFactory.getResourceChangeScannerService().stop(); // 2) stop the notifier ResourceFactory.getResourceChangeNotifierService().stop(); // 3) set the system event listener back to the original implementation SystemEventListenerFactory.setSystemEventListener(_originalSystemEventListener); _originalSystemEventListener = null; _running = false; if (LOGGER.isDebugEnabled()) { LOGGER.debug("Resource change service stopped."); } } }
SystemEventListenerFactory.setSystemEventListener(new LogSystemEventListener());