use of org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData in project wildfly by wildfly.
the class AbstractEjbXmlDescriptorProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
// get the deployment unit
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
// find the EJB jar metadata and start processing it
EjbJarMetaData ejbJarMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
if (ejbJarMetaData == null) {
return;
}
// process EJBs
EnterpriseBeansMetaData ejbs = ejbJarMetaData.getEnterpriseBeans();
if (ejbs != null && !ejbs.isEmpty()) {
for (EnterpriseBeanMetaData ejb : ejbs) {
if (this.getMetaDataType().isInstance(ejb)) {
this.processBeanMetaData((T) ejb, phaseContext);
}
}
}
}
use of org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData in project wildfly by wildfly.
the class AbstractDeploymentUnitProcessor method processDeploymentDescriptor.
protected void processDeploymentDescriptor(final DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException {
// find the EJB jar metadata and start processing it
final EjbJarMetaData ejbJarMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
if (ejbJarMetaData == null) {
return;
}
final SimpleSet<String> annotatedEJBs;
if (appclient) {
final List<ComponentDescription> additionalComponents = deploymentUnit.getAttachmentList(org.jboss.as.ee.component.Attachments.ADDITIONAL_RESOLVABLE_COMPONENTS);
annotatedEJBs = new SimpleSet<String>() {
@Override
public boolean contains(Object o) {
for (final ComponentDescription component : additionalComponents) {
if (component.getComponentName().equals(o)) {
return true;
}
}
return false;
}
};
} else {
final EjbJarDescription ejbJarDescription = getEjbJarDescription(deploymentUnit);
annotatedEJBs = new SimpleSet<String>() {
@Override
public boolean contains(Object o) {
return ejbJarDescription.hasComponent((String) o);
}
};
}
// process EJBs
final EnterpriseBeansMetaData ejbs = ejbJarMetaData.getEnterpriseBeans();
if (ejbs != null && !ejbs.isEmpty()) {
for (final EnterpriseBeanMetaData ejb : ejbs) {
final String beanName = ejb.getName();
// the important bit is to skip already processed EJBs via annotations
if (annotatedEJBs.contains(beanName)) {
continue;
}
processBeanMetaData(deploymentUnit, ejb);
}
}
EjbDeploymentMarker.mark(deploymentUnit);
}
Aggregations