Search in sources :

Example 56 with EEModuleDescription

use of org.jboss.as.ee.component.EEModuleDescription in project wildfly by wildfly.

the class WebServiceAnnotationProcessor method deploy.

@SuppressWarnings({ "unchecked", "rawtypes" })
public final void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
    final CompositeIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX);
    if (index == null || eeModuleDescription == null) {
        return;
    }
    for (final ClassAnnotationInformationFactory factory : factories) {
        final Map<String, ClassAnnotationInformation<?, ?>> data = factory.createAnnotationInformation(index, PropertyReplacers.noop());
        for (Map.Entry<String, ClassAnnotationInformation<?, ?>> entry : data.entrySet()) {
            EEModuleClassDescription clazz = eeModuleDescription.addOrGetLocalClassDescription(entry.getKey());
            clazz.addAnnotationInformation(entry.getValue());
        }
    }
}
Also used : EEModuleDescription(org.jboss.as.ee.component.EEModuleDescription) ClassAnnotationInformation(org.jboss.as.ee.metadata.ClassAnnotationInformation) ClassAnnotationInformationFactory(org.jboss.as.ee.metadata.ClassAnnotationInformationFactory) CompositeIndex(org.jboss.as.server.deployment.annotation.CompositeIndex) EEModuleClassDescription(org.jboss.as.ee.component.EEModuleClassDescription) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) Map(java.util.Map)

Example 57 with EEModuleDescription

use of org.jboss.as.ee.component.EEModuleDescription in project wildfly by wildfly.

the class WSIntegrationProcessorJAXWS_EJB method processAnnotation.

@SuppressWarnings("rawtypes")
private static void processAnnotation(final DeploymentUnit unit, final Class annotationType) {
    final EEModuleDescription moduleDescription = getRequiredAttachment(unit, EE_MODULE_DESCRIPTION);
    final JAXWSDeployment jaxwsDeployment = getJaxwsDeployment(unit);
    for (EEModuleClassDescription description : moduleDescription.getClassDescriptions()) {
        @SuppressWarnings("unchecked") ClassAnnotationInformation classAnnotationInfo = description.getAnnotationInformation(annotationType);
        if (classAnnotationInfo != null && !classAnnotationInfo.getClassLevelAnnotations().isEmpty()) {
            Object obj = classAnnotationInfo.getClassLevelAnnotations().get(0);
            AnnotationTarget target = null;
            if (obj instanceof WebServiceAnnotationInfo) {
                target = ((WebServiceAnnotationInfo) obj).getTarget();
            } else if (obj instanceof WebServiceProviderAnnotationInfo) {
                target = ((WebServiceProviderAnnotationInfo) obj).getTarget();
            } else {
                return;
            }
            final ClassInfo webServiceClassInfo = (ClassInfo) target;
            final String webServiceClassName = webServiceClassInfo.name().toString();
            final List<ComponentDescription> componentDescriptions = moduleDescription.getComponentsByClassName(webServiceClassName);
            final List<SessionBeanComponentDescription> sessionBeans = getSessionBeans(componentDescriptions);
            // TODO: assembly processed for each endpoint!
            final Set<String> securityRoles = getDeclaredSecurityRoles(unit, webServiceClassInfo);
            final WebContextAnnotationWrapper webCtx = getWebContextWrapper(webServiceClassInfo);
            final String authMethod = webCtx.getAuthMethod();
            final boolean isSecureWsdlAccess = webCtx.isSecureWsdlAccess();
            final String transportGuarantee = webCtx.getTransportGuarantee();
            final String realmName = webCtx.getRealmName();
            for (final SessionBeanComponentDescription sessionBean : sessionBeans) {
                if (sessionBean.isStateless() || sessionBean.isSingleton()) {
                    final EJBViewDescription ejbViewDescription = sessionBean.addWebserviceEndpointView();
                    final ServiceName ejbViewName = ejbViewDescription.getServiceName();
                    jaxwsDeployment.addEndpoint(new EJBEndpoint(sessionBean, ejbViewName, securityRoles, authMethod, realmName, isSecureWsdlAccess, transportGuarantee));
                }
            }
        }
    }
}
Also used : AnnotationTarget(org.jboss.jandex.AnnotationTarget) SessionBeanComponentDescription(org.jboss.as.ejb3.component.session.SessionBeanComponentDescription) ComponentDescription(org.jboss.as.ee.component.ComponentDescription) EJBViewDescription(org.jboss.as.ejb3.component.EJBViewDescription) EEModuleDescription(org.jboss.as.ee.component.EEModuleDescription) ClassAnnotationInformation(org.jboss.as.ee.metadata.ClassAnnotationInformation) ServiceName(org.jboss.msc.service.ServiceName) EJBEndpoint(org.jboss.as.webservices.metadata.model.EJBEndpoint) JAXWSDeployment(org.jboss.as.webservices.metadata.model.JAXWSDeployment) EEModuleClassDescription(org.jboss.as.ee.component.EEModuleClassDescription) SessionBeanComponentDescription(org.jboss.as.ejb3.component.session.SessionBeanComponentDescription) ClassInfo(org.jboss.jandex.ClassInfo)

Example 58 with EEModuleDescription

use of org.jboss.as.ee.component.EEModuleDescription in project wildfly by wildfly.

the class AbstractIntegrationProcessorJAXWS method deploy.

@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit unit = phaseContext.getDeploymentUnit();
    if (DeploymentTypeMarker.isType(DeploymentType.EAR, unit)) {
        return;
    }
    final CompositeIndex index = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
    if (index == null) {
        return;
    }
    final EEModuleDescription eeModuleDescription = unit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION);
    processAnnotation(unit, eeModuleDescription);
}
Also used : EEModuleDescription(org.jboss.as.ee.component.EEModuleDescription) CompositeIndex(org.jboss.as.server.deployment.annotation.CompositeIndex) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 59 with EEModuleDescription

use of org.jboss.as.ee.component.EEModuleDescription in project wildfly by wildfly.

the class XTSInterceptorDeploymentProcessor method deploy.

public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit unit = phaseContext.getDeploymentUnit();
    final EEModuleDescription moduleDescription = unit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
    for (ComponentDescription component : moduleDescription.getComponentDescriptions()) {
        if (component instanceof SessionBeanComponentDescription) {
            registerSessionBeanInterceptors((SessionBeanComponentDescription) component);
        }
        if (component instanceof WSComponentDescription) {
            registerWSPOJOInterceptors((WSComponentDescription) component);
        }
    }
}
Also used : ComponentDescription(org.jboss.as.ee.component.ComponentDescription) WSComponentDescription(org.jboss.as.webservices.injection.WSComponentDescription) SessionBeanComponentDescription(org.jboss.as.ejb3.component.session.SessionBeanComponentDescription) EEModuleDescription(org.jboss.as.ee.component.EEModuleDescription) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) SessionBeanComponentDescription(org.jboss.as.ejb3.component.session.SessionBeanComponentDescription) WSComponentDescription(org.jboss.as.webservices.injection.WSComponentDescription)

Example 60 with EEModuleDescription

use of org.jboss.as.ee.component.EEModuleDescription in project wildfly by wildfly.

the class Utils method registerAsComponent.

public static void registerAsComponent(String listener, DeploymentUnit deploymentUnit) {
    final EEApplicationClasses applicationClasses = deploymentUnit.getAttachment(Attachments.EE_APPLICATION_CLASSES_DESCRIPTION);
    final EEModuleDescription module = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
    final WebComponentDescription componentDescription = new WebComponentDescription(listener, listener, module, deploymentUnit.getServiceName(), applicationClasses);
    module.addComponent(componentDescription);
    deploymentUnit.addToAttachmentList(WebComponentDescription.WEB_COMPONENTS, componentDescription.getStartServiceName());
}
Also used : EEModuleDescription(org.jboss.as.ee.component.EEModuleDescription) WebComponentDescription(org.jboss.as.web.common.WebComponentDescription) EEApplicationClasses(org.jboss.as.ee.component.EEApplicationClasses)

Aggregations

EEModuleDescription (org.jboss.as.ee.component.EEModuleDescription)90 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)77 ComponentDescription (org.jboss.as.ee.component.ComponentDescription)44 Module (org.jboss.modules.Module)27 ServiceName (org.jboss.msc.service.ServiceName)21 EEApplicationClasses (org.jboss.as.ee.component.EEApplicationClasses)18 CompositeIndex (org.jboss.as.server.deployment.annotation.CompositeIndex)17 EJBComponentDescription (org.jboss.as.ejb3.component.EJBComponentDescription)16 DeploymentUnitProcessingException (org.jboss.as.server.deployment.DeploymentUnitProcessingException)16 HashSet (java.util.HashSet)14 HashMap (java.util.HashMap)11 DeploymentReflectionIndex (org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex)11 BindingConfiguration (org.jboss.as.ee.component.BindingConfiguration)10 SessionBeanComponentDescription (org.jboss.as.ejb3.component.session.SessionBeanComponentDescription)10 ServiceTarget (org.jboss.msc.service.ServiceTarget)10 AnnotationInstance (org.jboss.jandex.AnnotationInstance)9 ComponentConfiguration (org.jboss.as.ee.component.ComponentConfiguration)8 DeploymentPhaseContext (org.jboss.as.server.deployment.DeploymentPhaseContext)8 EjbJarMetaData (org.jboss.metadata.ejb.spec.EjbJarMetaData)7 Map (java.util.Map)6