@Override
public IAuthenticationService addingService(ServiceReference<IAuthenticationService> reference) {
if ("true".equals(reference.getProperty(PROP_CONFIGURED))) //$NON-NLS-1$
return null;
IAuthenticationService authService = super.addingService(reference);
Dictionary dictionary = new Properties();
dictionary.put(PROP_CONFIGURED, "true"); //$NON-NLS-1$
if (getService() != null) {
getService().setRegistered(false);
}
authService.setRegistered(true);
context.registerService(IAuthenticationService.class.getName(), authService, dictionary);
return authService;
}