public IdentityMgtEventListener() { module = IdentityMgtConfig.getInstance().getIdentityDataStore(); String adminUserName = IdentityMgtServiceComponent.getRealmService() .getBootstrapRealmConfiguration() .getAdminUserName(); try { IdentityMgtConfig config = IdentityMgtConfig.getInstance(); // Get the policy registry with the loaded policies. policyRegistry = config.getPolicyRegistry(); if (config.isListenerEnable()) { UserStoreManager userStoreMng = IdentityMgtServiceComponent.getRealmService().getBootstrapRealm().getUserStoreManager(); if (!userStoreMng.isReadOnly()) { userStoreMng.setUserClaimValue( adminUserName, UserIdentityDataStore.ACCOUNT_LOCK, Boolean.toString(false), null); } } } catch (UserStoreException e) { log.error("Error while init identity listener", e); } }