Search in sources :

Example 1 with WebServiceProviderAnnotationInfo

use of org.jboss.as.webservices.deployers.WebServiceProviderAnnotationInfo in project wildfly by wildfly.

the class ASHelper method isJaxwsEndpoint.

public static boolean isJaxwsEndpoint(final EEModuleClassDescription classDescription, final CompositeIndex index) {
    ClassInfo classInfo = null;
    WebServiceAnnotationInfo webserviceAnnoationInfo = null;
    final ClassAnnotationInformation<WebService, WebServiceAnnotationInfo> classAnnotationInfo = classDescription.getAnnotationInformation(WebService.class);
    if (classAnnotationInfo != null && !classAnnotationInfo.getClassLevelAnnotations().isEmpty()) {
        webserviceAnnoationInfo = classAnnotationInfo.getClassLevelAnnotations().get(0);
        classInfo = (ClassInfo) webserviceAnnoationInfo.getTarget();
    }
    WebServiceProviderAnnotationInfo webserviceProviderAnnoationInfo = null;
    final ClassAnnotationInformation<WebServiceProvider, WebServiceProviderAnnotationInfo> providerAnnotationInfo = classDescription.getAnnotationInformation(WebServiceProvider.class);
    if (providerAnnotationInfo != null && !providerAnnotationInfo.getClassLevelAnnotations().isEmpty()) {
        webserviceProviderAnnoationInfo = providerAnnotationInfo.getClassLevelAnnotations().get(0);
        classInfo = (ClassInfo) webserviceProviderAnnoationInfo.getTarget();
    }
    if (classInfo == null) {
        return false;
    }
    // assert JAXWS endpoint class flags
    final short flags = classInfo.flags();
    if (Modifier.isInterface(flags))
        return false;
    if (Modifier.isAbstract(flags))
        return false;
    if (!Modifier.isPublic(flags))
        return false;
    if (isJaxwsService(classInfo, index))
        return false;
    if (webserviceAnnoationInfo != null && webserviceProviderAnnoationInfo != null) {
        WSLogger.ROOT_LOGGER.mutuallyExclusiveAnnotations(classInfo.name().toString());
        return false;
    }
    if (Modifier.isFinal(flags)) {
        WSLogger.ROOT_LOGGER.finalEndpointClassDetected(classInfo.name().toString());
        return false;
    }
    return true;
}
Also used : WebServiceProvider(javax.xml.ws.WebServiceProvider) WebService(javax.jws.WebService) WebServiceProviderAnnotationInfo(org.jboss.as.webservices.deployers.WebServiceProviderAnnotationInfo) ClassInfo(org.jboss.jandex.ClassInfo) WebServiceAnnotationInfo(org.jboss.as.webservices.deployers.WebServiceAnnotationInfo)

Aggregations

WebService (javax.jws.WebService)1 WebServiceProvider (javax.xml.ws.WebServiceProvider)1 WebServiceAnnotationInfo (org.jboss.as.webservices.deployers.WebServiceAnnotationInfo)1 WebServiceProviderAnnotationInfo (org.jboss.as.webservices.deployers.WebServiceProviderAnnotationInfo)1 ClassInfo (org.jboss.jandex.ClassInfo)1