use of org.wso2.carbon.identity.user.store.configuration.UserStoreConfigServiceImpl in project carbon-identity-framework by wso2.
the class UserStoreConfigComponent method activate.
/**
* @param ctxt
*/
@Activate
protected void activate(ComponentContext ctxt) {
if (log.isDebugEnabled()) {
log.debug("Identity User Store bundle is activated.");
}
try {
BundleContext bundleContext = ctxt.getBundleContext();
AbstractUserStoreDAOFactory fileBasedUserStoreDAOFactory = new FileBasedUserStoreDAOFactory();
AbstractUserStoreDAOFactory databaseBasedUserStoreDAOFactory = new DatabaseBasedUserStoreDAOFactory();
ServiceRegistration serviceRegistration = bundleContext.registerService(AbstractUserStoreDAOFactory.class.getName(), fileBasedUserStoreDAOFactory, null);
bundleContext.registerService(AbstractUserStoreDAOFactory.class.getName(), databaseBasedUserStoreDAOFactory, null);
UserStoreConfigService userStoreConfigService = new UserStoreConfigServiceImpl();
ctxt.getBundleContext().registerService(UserStoreConfigService.class.getName(), userStoreConfigService, null);
UserStoreConfigListenersHolder.getInstance().setUserStoreConfigService(userStoreConfigService);
UserStoreHashProviderConfigListenerImpl userStoreHashProviderListener = new UserStoreHashProviderConfigListenerImpl();
ctxt.getBundleContext().registerService(UserStoreConfigListener.class.getName(), userStoreHashProviderListener, null);
UserStoreConfigListenersHolder.getInstance().setUserStoreConfigListenerService(userStoreHashProviderListener);
if (serviceRegistration != null) {
if (log.isDebugEnabled()) {
log.debug("FileBasedUserStoreDAOFactory is successfully registered.");
}
} else {
log.error("FileBasedUserStoreDAOFactory could not be registered.");
}
readAllowedUserstoreConfiguration();
readUserStoreAttributeMappingConfigs();
} catch (Throwable e) {
log.error("Failed to load user store org.wso2.carbon.identity.user.store.configuration details.", e);
}
if (log.isDebugEnabled()) {
log.debug("Identity User Store-Config bundle is activated.");
}
}
Aggregations