Search in sources :

Example 6 with EnterpriseBeanMetaData

use of org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData in project wildfly by wildfly.

the class AnnotatedEJBComponentDescriptionDeploymentUnitProcessor method processDeploymentDescriptor.

private void processDeploymentDescriptor(final DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException {
    // find the Jakarta Enterprise Beans 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 Jakarta Enterprise Beans
    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 Jakarta Enterprise Beans via annotations
            if (annotatedEJBs.contains(beanName)) {
                continue;
            }
            processBeanMetaData(deploymentUnit, ejb);
        }
    }
    EjbDeploymentMarker.mark(deploymentUnit);
}
Also used : ComponentDescription(org.jboss.as.ee.component.ComponentDescription) EnterpriseBeansMetaData(org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData) EjbJarMetaData(org.jboss.metadata.ejb.spec.EjbJarMetaData) EjbJarDescription(org.jboss.as.ejb3.deployment.EjbJarDescription) EnterpriseBeanMetaData(org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData)

Aggregations

EnterpriseBeanMetaData (org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData)6 EjbJarMetaData (org.jboss.metadata.ejb.spec.EjbJarMetaData)3 EnterpriseBeansMetaData (org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData)3 ComponentDescription (org.jboss.as.ee.component.ComponentDescription)2 EjbJarDescription (org.jboss.as.ejb3.deployment.EjbJarDescription)2 Method (java.lang.reflect.Method)1 TimedObject (javax.ejb.TimedObject)1 TransactionManagementType (javax.ejb.TransactionManagementType)1 InterceptorClassDescription (org.jboss.as.ee.component.interceptors.InterceptorClassDescription)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 ClassReflectionIndex (org.jboss.as.server.deployment.reflect.ClassReflectionIndex)1 MethodIdentifier (org.jboss.invocation.proxy.MethodIdentifier)1 ITimeoutTarget (org.jboss.metadata.ejb.common.ITimeoutTarget)1 AroundInvokeMetaData (org.jboss.metadata.ejb.spec.AroundInvokeMetaData)1 AroundInvokesMetaData (org.jboss.metadata.ejb.spec.AroundInvokesMetaData)1 MessageDrivenBeanMetaData (org.jboss.metadata.ejb.spec.MessageDrivenBeanMetaData)1 SessionBeanMetaData (org.jboss.metadata.ejb.spec.SessionBeanMetaData)1 LifecycleCallbackMetaData (org.jboss.metadata.javaee.spec.LifecycleCallbackMetaData)1 LifecycleCallbacksMetaData (org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData)1