@PostConstruct public void setup() { Path defaultRoot = null; for (final Path path : fs.getRootDirectories()) { if (path.toUri().toString().contains("/master@")) { defaultRoot = path; break; } } if (defaultRoot == null) { throw new RuntimeException("Could not resolve 'systemFS' main root directory."); } systemRepository.setRoot(convert(defaultRoot)); // enable monitor by default if (System.getProperty(MONITOR_DISABLED) == null) { watchService = fs.newWatchService(); configUpdates = new CheckConfigurationUpdates(watchService); final ConfigServiceWatchServiceExecutor configServiceWatchServiceExecutor = getWatchServiceExecutor(); jobs.add(executorService.submit(new DescriptiveRunnable() { @Override public String getDescription() { return configUpdates.getDescription(); } @Override public void run() { configUpdates.execute(configServiceWatchServiceExecutor); } })); } }
@PreDestroy public void shutdown() { if (configUpdates != null) { configUpdates.deactivate();
@PreDestroy public void shutdown() { if (configUpdates != null) { configUpdates.deactivate();
@PostConstruct public void setup() { Path defaultRoot = null; for (final Path path : fs.getRootDirectories()) { if (path.toUri().toString().contains("/master@")) { defaultRoot = path; break; } } if (defaultRoot == null) { throw new RuntimeException("Could not resolve 'systemFS' main root directory."); } // enable monitor by default if (System.getProperty(MONITOR_DISABLED) == null) { watchService = fs.newWatchService(); configUpdates = new CheckConfigurationUpdates(watchService); final ConfigServiceWatchServiceExecutor configServiceWatchServiceExecutor = getWatchServiceExecutor(); jobs.add(executorService.submit(new DescriptiveRunnable() { @Override public String getDescription() { return configUpdates.getDescription(); } @Override public void run() { configUpdates.execute(configServiceWatchServiceExecutor); } })); } }
@Override public String getDescription() { return configUpdates.getDescription(); }
@Override public String getDescription() { return configUpdates.getDescription(); }
@Override public void run() { configUpdates.execute(configServiceWatchServiceExecutor); } }));
@Override public void run() { configUpdates.execute(configServiceWatchServiceExecutor); } }));