* @throws Exception UserStoreException
*/
public static UserStoreManager getUserStoreManager(Tenant tenant, int tenantId)
throws Exception {
// get the system registry for the tenant
RealmConfiguration realmConfig = TenantMgtServiceComponent.getBootstrapRealmConfiguration();
TenantMgtConfiguration tenantMgtConfiguration =
TenantMgtServiceComponent.getRealmService().getTenantMgtConfiguration();
UserRealm userRealm;
try {
MultiTenantRealmConfigBuilder builder = TenantMgtServiceComponent.getRealmService().
getMultiTenantRealmConfigBuilder();
RealmConfiguration realmConfigToPersist = builder.
getRealmConfigForTenantToPersist(realmConfig, tenantMgtConfiguration,
tenant, tenantId);
RealmConfiguration realmConfigToCreate =
builder.getRealmConfigForTenantToCreateRealmOnTenantCreation(
realmConfig, realmConfigToPersist, tenantId);
userRealm = TenantMgtServiceComponent.getRealmService().
getUserRealm(realmConfigToCreate);
} catch (UserStoreException e) {