Examples of JAXWSDeployment


Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

     *
     * @param unit deployment unit
     * @return list of JAXWS EJBs meta data
     */
    public static List<EJBEndpoint> getJaxwsEjbs(final DeploymentUnit unit) {
        final JAXWSDeployment jaxwsDeployment = getOptionalAttachment(unit, WSAttachmentKeys.JAXWS_ENDPOINTS_KEY);
        return jaxwsDeployment != null ? jaxwsDeployment.getEjbEndpoints() : Collections.<EJBEndpoint>emptyList();
    }
View Full Code Here

Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

     *
     * @param unit deployment unit
     * @return list of JAXWS POJOs meta data
     */
    public static List<POJOEndpoint> getJaxwsPojos(final DeploymentUnit unit) {
        final JAXWSDeployment jaxwsDeployment = unit.getAttachment(WSAttachmentKeys.JAXWS_ENDPOINTS_KEY);
        return jaxwsDeployment != null ? jaxwsDeployment.getPojoEndpoints() : Collections.<POJOEndpoint>emptyList();
    }
View Full Code Here

Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

       final CompositeIndex compositeIndex = getRequiredAttachment(unit, Attachments.COMPOSITE_ANNOTATION_INDEX);
       return compositeIndex.getAnnotations(annotation);
    }

    public static JAXWSDeployment getJaxwsDeployment(final DeploymentUnit unit) {
        JAXWSDeployment wsDeployment = unit.getAttachment(JAXWS_ENDPOINTS_KEY);
        if (wsDeployment == null) {
            wsDeployment = new JAXWSDeployment();
            unit.putAttachment(JAXWS_ENDPOINTS_KEY, wsDeployment);
        }
        return wsDeployment;
    }
View Full Code Here

Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

    }
    @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);
                final Set<String> securityRoles = getDeclaredSecurityRoles(unit, webServiceClassInfo); // TODO: assembly processed for each endpoint!
                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));
                    }
                }
            }
        }
    }
View Full Code Here

Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

    }

    @Override
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        final JAXWSDeployment wsDeployment = unit.getAttachment(JAXWS_ENDPOINTS_KEY);
        if (wsDeployment != null) {
            final Module module = unit.getAttachment(Attachments.MODULE);
            final DeploymentReflectionIndex deploymentReflectionIndex = unit
                    .getAttachment(org.jboss.as.server.deployment.Attachments.REFLECTION_INDEX);
            final ClassLoader moduleClassLoader = module.getClassLoader();
            for (AbstractEndpoint pojoEndpoint : wsDeployment.getPojoEndpoints()) {
                verifyEndpoint(pojoEndpoint, moduleClassLoader, deploymentReflectionIndex);
            }
            for (AbstractEndpoint ejbEndpoint : wsDeployment.getEjbEndpoints()) {
                verifyEndpoint(ejbEndpoint, moduleClassLoader, deploymentReflectionIndex);
            }
            verifyApacheCXFModuleDependencyRequirement(unit);
        }
    }
View Full Code Here

Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

                jseArchiveMDBuilder.setContextRoot(contextRoot);
                dep.addAttachment(JSEArchiveMetaData.class, jseArchiveMDBuilder.build());
            }
        }

        final JAXWSDeployment jaxwsDeployment = WSHelper.getRequiredAttachment(dep, JAXWSDeployment.class);
        final List<EJBMetaData> wsEjbsMD = new LinkedList<EJBMetaData>();
        final JBossWebservicesMetaData jbossWebservicesMD = WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);

        for (final EJBEndpoint jbossEjbMD : jaxwsDeployment.getEjbEndpoints()) {
            buildEnterpriseBeanMetaData(wsEjbsMD, jbossEjbMD, jbossWebservicesMD);
        }

        ejbArchiveMDBuilder.setEnterpriseBeans(wsEjbsMD);
    }
View Full Code Here

Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

            if (isJaxwsEndpoint(classDescritpion, index) && !exclude(unit, classDescritpion)) {
                classDescriptionMap.put(classDescritpion.getClassName(), classDescritpion);
            }
        }
        final JBossWebMetaData jbossWebMD = getJBossWebMetaData(unit);
        final JAXWSDeployment jaxwsDeployment = getJaxwsDeployment(unit);
        if (jbossWebMD != null) {
            final Set<String> matchedEps = new HashSet<String>();
            for (final ServletMetaData servletMD : getServlets(jbossWebMD)) {
                final String endpointClassName = getEndpointClassName(servletMD);
                final String endpointName = getEndpointName(servletMD);
                if (classDescriptionMap.containsKey(endpointClassName) || matchedEps.contains(endpointClassName)) {
                    // creating component description for POJO endpoint
                    final ComponentDescription pojoComponent = createComponentDescription(unit, endpointName,
                            endpointClassName, endpointName);
                    final ServiceName pojoViewName = registerView(pojoComponent, endpointClassName);
                    final String urlPattern = getUrlPattern(endpointName, unit);
                    jaxwsDeployment.addEndpoint(new POJOEndpoint(endpointName, endpointClassName, pojoViewName, urlPattern));
                    classDescriptionMap.remove(endpointClassName);
                    matchedEps.add(endpointClassName);
                } else {
                    if (unit.getParent() != null && DeploymentTypeMarker.isType(DeploymentType.EAR, unit.getParent())) {
                        final EEModuleDescription eeModuleDescription = unit.getParent().getAttachment(
                                org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION);
                        final CompositeIndex parentIndex = unit.getParent().getAttachment( Attachments.COMPOSITE_ANNOTATION_INDEX);
                        for (EEModuleClassDescription classDescription : eeModuleDescription.getClassDescriptions()) {
                            if (classDescription.getClassName().equals(endpointClassName)
                                    && isJaxwsEndpoint(classDescription, parentIndex)) {
                                final ComponentDescription pojoComponent = createComponentDescription(unit, endpointName,
                                        endpointClassName, endpointName);
                                final ServiceName pojoViewName = registerView(pojoComponent, endpointClassName);
                                final String urlPattern = getUrlPattern(endpointName, unit);
                                jaxwsDeployment.addEndpoint(new POJOEndpoint(endpointName, endpointClassName, pojoViewName, urlPattern));

                            }
                        }
                    }
                }
            }
        }

        for (EEModuleClassDescription classDescription : classDescriptionMap.values()) {
            ClassInfo classInfo = null;
            String serviceName = null;
            String urlPattern = null;

            // #1 Override serviceName with the explicit urlPattern from port-component/port-component-uri in jboss-webservices.xml
            EJBEndpoint ejbEndpoint = getWebserviceMetadataEJBEndpoint(jaxwsDeployment, classDescription.getClassName());
            if (ejbEndpoint != null) {
                urlPattern = UrlPatternUtils.getUrlPatternByPortComponentURI(
                    getJBossWebserviceMetaDataPortComponent(unit, ejbEndpoint.getName()));
            }

            // #2 Override serviceName with @WebContext.urlPattern
            if (urlPattern == null) {
                final ClassAnnotationInformation<WebContext, WebContextAnnotationInfo> annotationWebContext =
                    classDescription.getAnnotationInformation(WebContext.class);
                if (annotationWebContext != null) {
                    WebContextAnnotationInfo wsInfo = annotationWebContext.getClassLevelAnnotations().get(0);
                    if (wsInfo != null && wsInfo.getUrlPattern().length() > 0) {
                        urlPattern = wsInfo.getUrlPattern();
                    }
                }
            }

            // #3 use serviceName declared in a class annotation
            if (urlPattern == null) {
                final ClassAnnotationInformation<WebService, WebServiceAnnotationInfo> annotationInfo = classDescription
                    .getAnnotationInformation(WebService.class);
                if (annotationInfo != null) {
                    WebServiceAnnotationInfo wsInfo = annotationInfo.getClassLevelAnnotations().get(0);
                    serviceName = wsInfo.getServiceName();
                    classInfo = (ClassInfo)wsInfo.getTarget();

                    urlPattern = UrlPatternUtils.getUrlPattern(classInfo.name().local(), serviceName);
                    if (jaxwsDeployment.contains(urlPattern)){
                        urlPattern = UrlPatternUtils.getUrlPattern(classInfo.name().local(), serviceName, wsInfo.getName());
                    }
                }

                final ClassAnnotationInformation<WebServiceProvider, WebServiceProviderAnnotationInfo> annotationProviderInfo = classDescription
                    .getAnnotationInformation(WebServiceProvider.class);
                if (annotationProviderInfo != null) {
                    WebServiceProviderAnnotationInfo wsInfo = annotationProviderInfo.getClassLevelAnnotations().get(0);
                    serviceName = wsInfo.getServiceName();
                    classInfo = (ClassInfo)wsInfo.getTarget();
                }
            }

            if (classInfo != null) {
                final String endpointClassName = classDescription.getClassName();
                final ComponentDescription pojoComponent = createComponentDescription(unit, endpointClassName,
                        endpointClassName, endpointClassName);
                final ServiceName pojoViewName = registerView(pojoComponent, endpointClassName);
                if (urlPattern == null) {
                    urlPattern = UrlPatternUtils.getUrlPattern(classInfo.name().local(), serviceName);
                }
                // register POJO endpoint
                jaxwsDeployment.addEndpoint(new POJOEndpoint(endpointClassName,
                    pojoViewName, UrlPatternUtils.getUrlPattern(urlPattern)));
            }
        }

    }
View Full Code Here

Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

    public WSEndpointDeploymentUnit(ClassLoader loader, String context, Map<String, String> urlPatternToClassName,
            JBossWebMetaData jbossWebMetaData, WebservicesMetaData metadata, JBossWebservicesMetaData jbwsMetaData) {
        this.deploymentName = context + ".deployment";

        JAXWSDeployment jaxwsDeployment = new JAXWSDeployment();
        if (jbossWebMetaData == null) {
            jbossWebMetaData = new JBossWebMetaData();
        }
        jbossWebMetaData.setContextRoot(context);
        String endpointName = null;
View Full Code Here

Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

    }

    private static void processAnnotation(final DeploymentUnit unit, final DotName annotation) {
        final List<AnnotationInstance> webServiceAnnotations = getAnnotations(unit, annotation);
        final EEModuleDescription moduleDescription = getRequiredAttachment(unit, EE_MODULE_DESCRIPTION);
        final JAXWSDeployment jaxwsDeployment = getJaxwsDeployment(unit);

        for (final AnnotationInstance webServiceAnnotation : webServiceAnnotations) {
            final AnnotationTarget target = webServiceAnnotation.target();
            final ClassInfo webServiceClassInfo = (ClassInfo) target;
            final String webServiceClassName = webServiceClassInfo.name().toString();
            final List<ComponentDescription> componentDescriptions = moduleDescription.getComponentsByClassName(webServiceClassName);
            final List<SessionBeanComponentDescription> sessionBeans = getSessionBeans(componentDescriptions);
            final Set<String> securityRoles = getSecurityRoles(unit, webServiceClassInfo); // TODO: assembly processed for each endpoint!
            final WebContextAnnotationWrapper webCtx = getWebContextWrapper(webServiceClassInfo);
            final String authMethod = webCtx.getAuthMethod();
            final boolean isSecureWsdlAccess = webCtx.isSecureWsdlAccess();
            final String transportGuarantee = webCtx.getTransportGuarantee();


            for (final SessionBeanComponentDescription sessionBean : sessionBeans) {
                if (sessionBean.isStateless() || sessionBean.isSingleton()) {
                    final EJBViewDescription ejbViewDescription = sessionBean.addWebserviceEndpointView();
                    final String ejbViewName = ejbViewDescription.getServiceName().getCanonicalName();
                    jaxwsDeployment.addEndpoint(new EJBEndpoint(sessionBean, ejbViewName, securityRoles, authMethod, isSecureWsdlAccess, transportGuarantee));
                }
            }
        }
    }
View Full Code Here

Examples of org.jboss.as.webservices.metadata.model.JAXWSDeployment

     *
     * @param unit deployment unit
     * @return list of JAXWS EJBs meta data
     */
    public static List<EJBEndpoint> getJaxwsEjbs(final DeploymentUnit unit) {
        final JAXWSDeployment jaxwsDeployment = getOptionalAttachment(unit, WSAttachmentKeys.JAXWS_ENDPOINTS_KEY);
        final boolean hasEjbEndpoints = jaxwsDeployment != null ? jaxwsDeployment.getEjbEndpoints().size() > 0 : false;
        return hasEjbEndpoints ? jaxwsDeployment.getEjbEndpoints() : Collections.<EJBEndpoint>emptyList();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.