// no-op
}
@Override
protected void handleDeploymentDescriptor(DeploymentUnit deploymentUnit, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, EJBComponentDescription ejbComponentDescription) throws DeploymentUnitProcessingException {
final SecurityRolesMetaData roleMappings = new SecurityRolesMetaData();
final EjbJarMetaData ejbJarMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
if (ejbJarMetaData != null) {
final AssemblyDescriptorMetaData assemblyDescriptorMetaData = ejbJarMetaData.getAssemblyDescriptor();
if (assemblyDescriptorMetaData != null) {
// get the mapping between principal to rolename, defined in the assembly descriptor
final List<SecurityRoleMetaData> securityRoleMetaDatas = assemblyDescriptorMetaData.getAny(SecurityRoleMetaData.class);
if (securityRoleMetaDatas != null) {
for (SecurityRoleMetaData securityRoleMetaData : securityRoleMetaDatas) {
roleMappings.add(securityRoleMetaData);
}
}
}
}
//Let us look at the ear metadata also
DeploymentUnit parent = deploymentUnit.getParent();
if (parent != null) {
final EarMetaData earMetaData = parent.getAttachment(Attachments.EAR_METADATA);
if (earMetaData != null) {
SecurityRolesMetaData earSecurityRolesMetaData = earMetaData.getSecurityRoles();
SecurityRolesMetaDataMerger.merge(roleMappings, roleMappings, earSecurityRolesMetaData);
}
}
// add it to the EJB component description
ejbComponentDescription.setSecurityRoles(roleMappings);