// Security domain
String securityDomain = earMetaData.getSecurityDomain();
if(securityDomain != null && mergedMetaData.getSecurityDomain() == null)
mergedMetaData.setSecurityDomain(securityDomain);
//Security Roles
SecurityRolesMetaData earSecurityRolesMetaData = earMetaData.getSecurityRoles();
if(earSecurityRolesMetaData != null)
{
JBossAssemblyDescriptorMetaData jadmd = mergedMetaData.getAssemblyDescriptor();
if( jadmd == null)
{
jadmd = new JBossAssemblyDescriptorMetaData();
mergedMetaData.setAssemblyDescriptor(jadmd);
}
SecurityRolesMetaData mergedSecurityRolesMetaData = jadmd.getSecurityRoles();
if(mergedSecurityRolesMetaData == null)
jadmd.setSecurityRoles(earSecurityRolesMetaData);
//perform a merge to rebuild the principalVersusRolesMap
if(mergedSecurityRolesMetaData != null )
{
mergedSecurityRolesMetaData.merge(mergedSecurityRolesMetaData,
earSecurityRolesMetaData);
}
}
}