SecuritiesModel securities = domain.getSecurities();
if (securities != null) {
for (SecurityModel security : securities.getSecurities()) {
if (security != null) {
PropertiesModel properties = security.getProperties();
ServiceSecurity value = new DefaultServiceSecurity()
.setName(security.getName())
.setCallbackHandler(security.getCallbackHandler(getClass().getClassLoader()))
.setProperties(properties != null ? properties.toMap() : null)
.setRolesAllowed(security.getRolesAllowed())
.setRunAs(security.getRunAs())
.setSecurityDomain(security.getSecurityDomain());
String key = value.getName();
if (!serviceSecurities.containsKey(key)) {
serviceSecurities.put(key, value);
} else {
throw BaseDeployMessages.MESSAGES.duplicateSecurityConfigurationNames(key);
}