if (applicationPolicy != null) {
final ApplicationPolicyRegistration applicationPolicyRegistration = (ApplicationPolicyRegistration) configurationValue
.getValue();
applicationPolicyRegistration.addApplicationPolicy(applicationPolicy.getName(), applicationPolicy);
}
final JNDIBasedSecurityManagement securityManagement = (JNDIBasedSecurityManagement) securityManagementValue.getValue();
Object cacheFactory = null;
if ("infinispan".equals(cacheType)) {
cacheFactory = cacheManagerValue.getValue();
} else if ("default".equals(cacheType)) {
cacheFactory = new DefaultAuthenticationCacheFactory();
}
try {
securityDomainContext = securityManagement.createSecurityDomainContext(name, cacheFactory);
} catch (Exception e) {
throw new StartException(e);
}
if (jsseSecurityDomain != null) {
try {
jsseSecurityDomain.reloadKeyAndTrustStore();
securityDomainContext.setJSSE(jsseSecurityDomain);
} catch (Exception e) {
throw new StartException(e);
}
}
securityManagement.getSecurityManagerMap().put(name, securityDomainContext);
}