// Override with meta data (JBossWebMetaData)
// Create a merged view
JBossWebMetaData mergedMetaData = new JBossWebMetaData();
mergedMetaData.merge(metaData, specMetaData);
// Incorporate any ear level overrides
DeploymentUnit topUnit = unit.getTopLevel();
if(topUnit != null && topUnit.getAttachment(JBossAppMetaData.class) != null)
{
JBossAppMetaData earMetaData = topUnit.getAttachment(JBossAppMetaData.class);
// Security domain
String securityDomain = earMetaData.getSecurityDomain();
if(securityDomain != null && mergedMetaData.getSecurityDomain() == null)
mergedMetaData.setSecurityDomain(securityDomain);
//Security Roles