@Override
public Object addingService(ServiceReference reference) {
if(managerServicePid.equals(reference.getProperty(Constants.SERVICE_PID))){
return null; //do not track this manager!
}
LanguageConfiguration langConf = new LanguageConfiguration(SUPPORTED_LANUAGES, DEFAULT_LANG_CONF);
try {
langConf.setConfiguration(reference);
} catch (ConfigurationException e) {
log.error("Unable to track ServiceReference {} becuase of invalid LanguageConfiguration("
+ SUPPORTED_LANUAGES+"="+reference.getProperty(SUPPORTED_LANUAGES)+")!",e);
return null;
}
Object service = bundleContext.getService(reference);
if(service != null){
ref2LangConfig.put(reference, langConf);
langTokenizers.clear();
}
return service;
}
@Override
public void modifiedService(ServiceReference reference, Object service) {
if(managerServicePid.equals(reference.getProperty(Constants.SERVICE_PID))){
return; //ignore this service!
}
LanguageConfiguration langConf = new LanguageConfiguration(SUPPORTED_LANUAGES, DEFAULT_LANG_CONF);
try {
langConf.setConfiguration(reference);
ref2LangConfig.put(reference, langConf);
langTokenizers.clear();
} catch (ConfigurationException e) {
log.error("Unable to track ServiceReference {} becuase of invalid LanguageConfiguration("
+ SUPPORTED_LANUAGES+"="+reference.getProperty(SUPPORTED_LANUAGES)+")!",e);