File[] files1 = new File[] { file1, file2, };
Resource[] resources1 = ResourceUtils.getResources(files1);
File[] files2 = new File[] { file3, file4, };
Resource[] resources2 = ResourceUtils.getResources(files2);
ScheduledModuleChangeMonitor monitor = new ScheduledModuleChangeMonitor();
monitor.setResourcesToMonitor("myplugin1", resources1);
monitor.setResourcesToMonitor("myplugin2", resources2);
final RecordingModuleChangeListener listener = new RecordingModuleChangeListener();
monitor.addModificationListener(listener);
monitor.setInitialDelay(0);
monitor.setCheckInterval(1);
monitor.start();
Thread.sleep(500);
FileCopyUtils.copy("file1 text modified", new FileWriter(file1));
FileCopyUtils.copy("file2 text modified", new FileWriter(file2));