@Override
public void start(BundleContext context) throws Exception {
this.context=context;
plugin = this;
super.start(context);
FileMonitor fileMonitor = FileMonitor.getInstance();
FileChangeListener listener = new FileChangeListener() {
public void fileChanged(String filename) {
ServiceTracker tracker = new ServiceTracker(Activator.this.context, Configurator.class.getName(), null);
tracker.open();
Configurator configurator = (Configurator) tracker.getService();
try {
configurator.applyConfiguration();
} catch (IOException e) {
e.printStackTrace();
}
finally{
tracker.close();
}
}
};;;
fileMonitor.addFileChangeListener(listener , BUNDLES_INFO, 30000);
}