use of org.jboss.metadata.ejb.jboss.IIOPMetaData in project wildfly by wildfly.
the class EjbIIOPDeploymentUnitProcessor method deploy.
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (!IIOPDeploymentMarker.isIIOPDeployment(deploymentUnit)) {
return;
}
final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
if (!EjbDeploymentMarker.isEjbDeployment(deploymentUnit)) {
return;
}
// a bean-name -> IIOPMetaData map, reflecting the assembly descriptor IIOP configuration.
Map<String, IIOPMetaData> iiopMetaDataMap = new HashMap<String, IIOPMetaData>();
final EjbJarMetaData ejbMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
if (ejbMetaData != null && ejbMetaData.getAssemblyDescriptor() != null) {
List<IIOPMetaData> iiopMetaDatas = ejbMetaData.getAssemblyDescriptor().getAny(IIOPMetaData.class);
if (iiopMetaDatas != null && iiopMetaDatas.size() > 0) {
for (IIOPMetaData metaData : iiopMetaDatas) {
iiopMetaDataMap.put(metaData.getEjbName(), metaData);
}
}
}
final DeploymentReflectionIndex deploymentReflectionIndex = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.REFLECTION_INDEX);
final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE);
if (moduleDescription != null) {
for (final ComponentDescription componentDescription : moduleDescription.getComponentDescriptions()) {
if (componentDescription instanceof EJBComponentDescription) {
final EJBComponentDescription ejbComponentDescription = (EJBComponentDescription) componentDescription;
if (ejbComponentDescription.getEjbRemoteView() != null && ejbComponentDescription.getEjbHomeView() != null) {
// check if there is IIOP metadata for the bean - first using the bean name, then the wildcard "*" if needed.
IIOPMetaData iiopMetaData = iiopMetaDataMap.get(ejbComponentDescription.getEJBName());
if (iiopMetaData == null) {
iiopMetaData = iiopMetaDataMap.get(IIOPMetaData.WILDCARD_BEAN_NAME);
}
// has been enabled by default in the EJB3 subsystem.
if (iiopMetaData != null || settingsService.isEnabledByDefault()) {
processEjb(ejbComponentDescription, deploymentReflectionIndex, module, phaseContext.getServiceTarget(), iiopMetaData);
}
}
}
}
}
}
Aggregations