geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r522146 - /geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
Date Sun, 25 Mar 2007 02:15:22 GMT
Author: gawor
Date: Sat Mar 24 19:15:21 2007
New Revision: 522146

URL: http://svn.apache.org/viewvc?view=rev&rev=522146
Log:
handle .value of WebServiceRef annotation (GERONIMO-3006)

Modified:
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java?view=diff&rev=522146&r1=522145&r2=522146
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
(original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
Sat Mar 24 19:15:21 2007
@@ -186,11 +186,11 @@
      * @param field      Field name with the @WebServiceRef annoation
      */
     private static void addWebServiceRef(AnnotatedApp annotatedApp, WebServiceRef annotation,
Class cls, Method method, Field field) {
-        log.debug("addWebServiceRef( " + annotatedApp.toString() + "," + '\n' +
-                           annotation.name() + "," + '\n' +
-                           (cls != null ? cls.getName() : null) + "," + '\n' +
-                           (method != null ? method.getName() : null) + "," + '\n' +
-                           (field != null ? field.getName() : null) + " ): Entry");
+        log.debug("addWebServiceRef( [annotatedApp] " + annotatedApp.toString() + "," + '\n'
+
+                           "[annotation] " +  annotation.toString() + "," + '\n' +
+                           "[cls] " + (cls != null ? cls.getName() : null) + "," + '\n' +
+                           "[method] " + (method != null ? method.getName() : null) + ","
+ '\n' +
+                           "[field] " + (field != null ? field.getName() : null) + " ): Entry");
 
         //------------------------------------------------------------------------------------------
         // WebServiceRef name:
@@ -227,14 +227,14 @@
         // -- When annotation is applied on a field:    Type is the field type (or as provided
on
         //                                              the annotation)
         //------------------------------------------------------------------------------------------
-        String webServiceRefType = annotation.type().getCanonicalName();
-        Class webServiceRefValue = annotation.value().getClass();
-        if (webServiceRefType.equals("") || webServiceRefType.equals(Object.class.getName()))
{
+        Class webServiceRefType = annotation.type();
+        Class webServiceRefValue = annotation.value();
+        if (webServiceRefType.equals(Object.class)) {
             if (method != null) {
-                webServiceRefType = method.getParameterTypes()[0].getCanonicalName();
+                webServiceRefType = method.getParameterTypes()[0];
             }
             else if (field != null) {
-                webServiceRefType = field.getType().getName();
+                webServiceRefType = field.getType();
             }
         }
         log.debug("addWebServiceRef(): webServiceRefType: " + webServiceRefType);
@@ -289,15 +289,21 @@
                 serviceRefName.setStringValue(webServiceRefName);
 
                 // service-ref-type
-                if ( !webServiceRefType.equals("") ) {
+                if (!webServiceRefType.equals(Object.class)) {
+                    FullyQualifiedClassType qualifiedClass = serviceRef.addNewServiceRefType();
+                    qualifiedClass.setStringValue(webServiceRefType.getName());
+                    serviceRef.setServiceRefType(qualifiedClass);
+                }
+
+                // service-ref-interface
+                if (!webServiceRefValue.equals(Object.class)) {
                     FullyQualifiedClassType qualifiedClass = serviceRef.addNewServiceInterface();
-                    qualifiedClass.setStringValue(webServiceRefType);
+                    qualifiedClass.setStringValue(webServiceRefValue.getName());
                     serviceRef.setServiceInterface(qualifiedClass);
                 }
-                else if ( !webServiceRefValue.equals("") ) {
-                    // service-ref-type
+                else {
                     FullyQualifiedClassType qualifiedClass = serviceRef.addNewServiceInterface();
-                    qualifiedClass.setStringValue(webServiceRefValue.getName());
+                    qualifiedClass.setStringValue(webServiceRefType.getName());
                     serviceRef.setServiceInterface(qualifiedClass);
                 }
 



Mime
View raw message