Package javax.xml.ws

Examples of javax.xml.ws.WebServiceRef


         if (Service.class.isAssignableFrom(targetClass))
            serviceRefUMDM.setServiceInterface(targetClass.getName());
      }
      else
      {
         final WebServiceRef serviceRefAnnotation = this.getWebServiceRefAnnotation(anElement, serviceRefUMDM);
         Class<?> targetClass = null;
         if (serviceRefAnnotation != null && (serviceRefAnnotation.type() != Object.class))
         {
            targetClass = serviceRefAnnotation.type();
            serviceRefUMDM.setServiceRefType(targetClass.getName());

            if (Service.class.isAssignableFrom(targetClass))
               serviceRefUMDM.setServiceInterface(targetClass.getName());
         }
View Full Code Here


   }

   private WebServiceRef getWebServiceRefAnnotation(final AnnotatedElement anElement,
         final UnifiedServiceRefMetaData serviceRefUMDM)
   {
      final WebServiceRef webServiceRefAnnotation = this.getAnnotation(anElement, WebServiceRef.class);
      final WebServiceRefs webServiceRefsAnnotation = this.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
View Full Code Here

        String handlerChainFile = annotation.file();
        log.debug("addHandlerChain(): handlerChainFile: " + handlerChainFile);

        // Determine ServiceRef name
        String serviceRefName;
        WebServiceRef webServiceRef = null;
        if ( method != null ) {
            webServiceRef = method.getAnnotation(WebServiceRef.class);
        }
        else if ( field != null ) {
            webServiceRef = field.getAnnotation(WebServiceRef.class);
        }
        if ( webServiceRef != null ) {
            serviceRefName = webServiceRef.name();
        }
        else {
            //TODO is this guaranteed to be ""? If so, simplify the code here
            serviceRefName = annotation.name();
        }
View Full Code Here

        List<Method> methodswithWebServiceRef = classFinder.findAnnotatedMethods(WebServiceRef.class);
        List<Field> fieldswithWebServiceRef = classFinder.findAnnotatedFields(WebServiceRef.class);

        // Class-level annotation
        for (Class cls : classeswithWebServiceRef) {
            WebServiceRef webServiceRef = (WebServiceRef) cls.getAnnotation(WebServiceRef.class);
            if (webServiceRef != null) {
                addWebServiceRef(annotatedApp, webServiceRef, cls, null, null);
            }
        }

        // Method-level annotation
        for (Method method : methodswithWebServiceRef) {
            WebServiceRef webServiceRef = method.getAnnotation(WebServiceRef.class);
            if (webServiceRef != null) {
                addWebServiceRef(annotatedApp, webServiceRef, null, method, null);
            }
        }

        // Field-level annotation
        for (Field field : fieldswithWebServiceRef) {
            WebServiceRef webServiceRef = field.getAnnotation(WebServiceRef.class);
            if (webServiceRef != null) {
                addWebServiceRef(annotatedApp, webServiceRef, null, null, field);
            }
        }
View Full Code Here

     * @param composite        - <code>TMFAnnotationComposite</code>
     * @param annotatedElement - <code>AnnotatedElement</code>
     */
    public static void attachWebServiceRefAnnotation(TMFAnnotationComposite composite,
                                                     AnnotatedElement annotatedElement) {
        WebServiceRef webServiceRef = (WebServiceRef)ConverterUtils.getAnnotation(
                WebServiceRef.class, annotatedElement);
        if (webServiceRef != null) {
            WebServiceRefAnnot wsrAnnot = ConverterUtils.createWebServiceRefAnnot(
                    webServiceRef);
            composite.setWebServiceRefAnnot(wsrAnnot);
View Full Code Here

                if (fields[i].isAnnotationPresent(EJB.class)) {
                    EJB annotation = (EJB) fields[i].getAnnotation(EJB.class);
                    lookupFieldResource(context, instance, fields[i], annotation.name());
                }
                if (fields[i].isAnnotationPresent(WebServiceRef.class)) {
                    WebServiceRef annotation =
                        (WebServiceRef) fields[i].getAnnotation(WebServiceRef.class);
                    lookupFieldResource(context, instance, fields[i], annotation.name());
                }
                if (fields[i].isAnnotationPresent(PersistenceContext.class)) {
                    PersistenceContext annotation =
                        (PersistenceContext) fields[i].getAnnotation(PersistenceContext.class);
                    lookupFieldResource(context, instance, fields[i], annotation.name());
                }
                if (fields[i].isAnnotationPresent(PersistenceUnit.class)) {
                    PersistenceUnit annotation =
                        (PersistenceUnit) fields[i].getAnnotation(PersistenceUnit.class);
                    lookupFieldResource(context, instance, fields[i], annotation.name());
                }
            }
           
            // Initialize methods annotations
            Method[] methods = instance.getClass().getDeclaredMethods();
            for (int i = 0; i < methods.length; i++) {
                if (methods[i].isAnnotationPresent(Resource.class)) {
                    Resource annotation = (Resource) methods[i].getAnnotation(Resource.class);
                    lookupMethodResource(context, instance, methods[i], annotation.name());
                }
                if (methods[i].isAnnotationPresent(EJB.class)) {
                    EJB annotation = (EJB) methods[i].getAnnotation(EJB.class);
                    lookupMethodResource(context, instance, methods[i], annotation.name());
                }
                if (methods[i].isAnnotationPresent(WebServiceRef.class)) {
                    WebServiceRef annotation =
                        (WebServiceRef) methods[i].getAnnotation(WebServiceRef.class);
                    lookupMethodResource(context, instance, methods[i], annotation.name());
                }
                if (methods[i].isAnnotationPresent(PersistenceContext.class)) {
                    PersistenceContext annotation =
                        (PersistenceContext) methods[i].getAnnotation(PersistenceContext.class);
                    lookupMethodResource(context, instance, methods[i], annotation.name());
                }
                if (methods[i].isAnnotationPresent(PersistenceUnit.class)) {
                    PersistenceUnit annotation =
                        (PersistenceUnit) methods[i].getAnnotation(PersistenceUnit.class);
                    lookupMethodResource(context, instance, methods[i], annotation.name());
                }
            }
           
            clazz = clazz.getSuperclass();
        }
View Full Code Here

            for (Class<?> clazz : classFinder.findAnnotatedClasses(WebServiceRefs.class)) {
                WebServiceRefs webServiceRefs = clazz.getAnnotation(WebServiceRefs.class);
                webservicerefList.addAll(asList(webServiceRefs.value()));
            }
            for (Class<?> clazz : classFinder.findAnnotatedClasses(WebServiceRef.class)) {
                WebServiceRef webServiceRef = clazz.getAnnotation(WebServiceRef.class);
                webservicerefList.add(webServiceRef);
            }

            for (WebServiceRef webserviceref : webservicerefList) {

                buildWebServiceRef(consumer, webserviceref, null, null, classLoader);
            }

            for (Field field : classFinder.findAnnotatedFields(WebServiceRef.class)) {
                WebServiceRef webserviceref = field.getAnnotation(WebServiceRef.class);
                HandlerChain handlerChain = field.getAnnotation(HandlerChain.class);

                Member member = new FieldMember(field);

                buildWebServiceRef(consumer, webserviceref, handlerChain, member, classLoader);
            }

            for (Method method : classFinder.findAnnotatedMethods(WebServiceRef.class)) {
                WebServiceRef webserviceref = method.getAnnotation(WebServiceRef.class);
                HandlerChain handlerChain = method.getAnnotation(HandlerChain.class);

                Member member = new MethodMember(method);

                buildWebServiceRef(consumer, webserviceref, handlerChain, member, classLoader);
View Full Code Here

            for (Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(WebServiceRefs.class)) {
                WebServiceRefs webServiceRefs = clazz.getAnnotation(WebServiceRefs.class);
                webservicerefList.addAll(asList(webServiceRefs.value()));
            }
            for (Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(WebServiceRef.class)) {
                WebServiceRef webServiceRef = clazz.getAnnotation(WebServiceRef.class);
                webservicerefList.add(webServiceRef);
            }

            for (WebServiceRef webserviceref : webservicerefList) {

                buildWebServiceRef(consumer, webserviceref, null, null, classLoader);
            }

            for (Annotated<Field> field : annotationFinder.findMetaAnnotatedFields(WebServiceRef.class)) {
                WebServiceRef webserviceref = field.getAnnotation(WebServiceRef.class);
                HandlerChain handlerChain = field.getAnnotation(HandlerChain.class);

                Member member = new FieldMember(field.get());

                buildWebServiceRef(consumer, webserviceref, handlerChain, member, classLoader);
            }

            for (Annotated<Method> method : annotationFinder.findMetaAnnotatedMethods(WebServiceRef.class)) {
                WebServiceRef webserviceref = method.getAnnotation(WebServiceRef.class);
                HandlerChain handlerChain = method.getAnnotation(HandlerChain.class);

                Member member = new MethodMember(method.get());

                buildWebServiceRef(consumer, webserviceref, handlerChain, member, classLoader);
View Full Code Here

            serviceRefUMDM.setServiceRefType(targetClass.getName());

            if (Service.class.isAssignableFrom(targetClass))
               serviceRefUMDM.setServiceInterface(targetClass.getName());
         } else {
            final WebServiceRef serviceRefAnnotation = getWebServiceRefAnnotation(anElement, serviceRefUMDM);
            Class<?> targetClass = null;
            if (serviceRefAnnotation != null && (serviceRefAnnotation.type() != Object.class))
            {
               targetClass = serviceRefAnnotation.type();
               serviceRefUMDM.setServiceRefType(targetClass.getName());

               if (Service.class.isAssignableFrom(targetClass))
                  serviceRefUMDM.setServiceInterface(targetClass.getName());
            }
View Full Code Here

         return declaringClass;
      }

      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())) {
View Full Code Here

TOP

Related Classes of javax.xml.ws.WebServiceRef

Copyright © 2018 www.massapicom. 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.