Search in sources :

Example 1 with WebServiceRefs

use of javax.xml.ws.WebServiceRefs in project wildfly by wildfly.

the class WSRefUtils method getWebServiceRefAnnotation.

private static WebServiceRef getWebServiceRefAnnotation(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) {
    final WebServiceRef webServiceRefAnnotation = getAnnotation(anElement, WebServiceRef.class);
    final WebServiceRefs webServiceRefsAnnotation = getAnnotation(anElement, WebServiceRefs.class);
    if (webServiceRefAnnotation == null && webServiceRefsAnnotation == null) {
        return null;
    }
    // Build the list of @WebServiceRef relevant annotations
    final List<WebServiceRef> wsrefList = new ArrayList<WebServiceRef>();
    if (webServiceRefAnnotation != null) {
        wsrefList.add(webServiceRefAnnotation);
    }
    if (webServiceRefsAnnotation != null) {
        for (final WebServiceRef webServiceRefAnn : webServiceRefsAnnotation.value()) {
            wsrefList.add(webServiceRefAnn);
        }
    }
    // Return effective @WebServiceRef annotation
    WebServiceRef returnValue = null;
    if (wsrefList.size() == 1) {
        returnValue = wsrefList.get(0);
    } else {
        for (WebServiceRef webServiceRefAnn : wsrefList) {
            if (serviceRefUMDM.getServiceRefName().endsWith(webServiceRefAnn.name())) {
                returnValue = webServiceRefAnn;
                break;
            }
        }
    }
    return returnValue;
}
Also used : ArrayList(java.util.ArrayList) WebServiceRefs(javax.xml.ws.WebServiceRefs) WebServiceRef(javax.xml.ws.WebServiceRef)

Example 2 with WebServiceRefs

use of javax.xml.ws.WebServiceRefs in project Payara by payara.

the class WebServiceRefsHandler method processAnnotation.

public HandlerProcessingResult processAnnotation(AnnotationInfo ainfo) throws AnnotationProcessorException {
    WebServiceRefs wsRefsAnnotation = (WebServiceRefs) ainfo.getAnnotation();
    WebServiceRef[] wsRefAnnotations = wsRefsAnnotation.value();
    List<HandlerProcessingResult> results = new ArrayList<HandlerProcessingResult>();
    for (WebServiceRef wsRef : wsRefAnnotations) {
        results.add(processAWsRef(ainfo, wsRef));
    }
    HandlerProcessingResult finalResult = null;
    for (HandlerProcessingResult result : results) {
        if (finalResult == null || (result.getOverallResult().compareTo(finalResult.getOverallResult()) > 0)) {
            finalResult = result;
        }
    }
    return finalResult;
}
Also used : HandlerProcessingResult(org.glassfish.apf.HandlerProcessingResult) ArrayList(java.util.ArrayList) WebServiceRefs(javax.xml.ws.WebServiceRefs) WebServiceRef(javax.xml.ws.WebServiceRef)

Aggregations

ArrayList (java.util.ArrayList)2 WebServiceRef (javax.xml.ws.WebServiceRef)2 WebServiceRefs (javax.xml.ws.WebServiceRefs)2 HandlerProcessingResult (org.glassfish.apf.HandlerProcessingResult)1