if (httpSess.getAttribute(ServerConstants.USER_LOGGED_IN) != null) {
try {
return AdminServicesUtil.getSystemRegistry();
} catch (CarbonException e) {
log.error("Error obtaining a registry instance", e);
throw new IdentityException(
"Error obtaining a registry instance", e);
}
}
}
return getRegistryForAnonymousSession(domainName, username);