if (module == null)
throw new DeploymentUnitProcessingException("Failed to get module attachment for " + phaseContext.getDeploymentUnit());
final ClassLoader classLoader = module.getClassLoader();
Connector cmd = connectorXmlDescriptor != null ? connectorXmlDescriptor.getConnector() : null;
final IronJacamar ijmd = ironJacamarXmlDescriptor != null ? ironJacamarXmlDescriptor.getIronJacamar() : null;
try {
// Annotation merging
Annotations annotator = new Annotations();
Map<ResourceRoot, Index> indexes = AnnotationIndexUtils.getAnnotationIndexes(deploymentUnit);
for (Entry<ResourceRoot, Index> entry : indexes.entrySet()) {
AnnotationRepository repository = new JandexAnnotationRepositoryImpl(entry.getValue(), classLoader);
cmd = annotator.merge(cmd, repository, classLoader);
}
// FIXME: when the connector is null the Iron Jacamar data is ignored
if (cmd != null) {
// Validate metadata
cmd.validate();
// Merge metadata
cmd = (new Merger()).mergeConnectorWithCommonIronJacamar(ijmd, cmd);
}