* @return an instance of {@code SecurityDomainContext}
* @throws Exception if an error occurs during creation
*/
public SecurityDomainContext createSecurityDomainContext(String securityDomain, Object cacheFactory) throws Exception {
log.debugf("Creating SDC for domain=" + securityDomain);
AuthenticationManager am = createAuthenticationManager(securityDomain);
// create authentication cache
if (cacheFactory instanceof EmbeddedCacheManager) {
EmbeddedCacheManager cacheManager = EmbeddedCacheManager.class.cast(cacheFactory);
@SuppressWarnings("rawtypes")
Cache cache = null;