geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r723773 - /geronimo/server/branches/2.1/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBMessageReceiver.java
Date Fri, 05 Dec 2008 15:52:10 GMT
Author: gawor
Date: Fri Dec  5 07:52:09 2008
New Revision: 723773

URL: http://svn.apache.org/viewvc?rev=723773&view=rev
Log:
check all interfaces for javax.xml.ws.Provider interface. Based on patch from Ivan (GERONIMO-4450)

Modified:
    geronimo/server/branches/2.1/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBMessageReceiver.java

Modified: geronimo/server/branches/2.1/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBMessageReceiver.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBMessageReceiver.java?rev=723773&r1=723772&r2=723773&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBMessageReceiver.java
(original)
+++ geronimo/server/branches/2.1/plugins/axis2/geronimo-axis2-ejb/src/main/java/org/apache/geronimo/axis2/ejb/EJBMessageReceiver.java
Fri Dec  5 07:52:09 2008
@@ -161,28 +161,22 @@
     }
     
     private Class<?> getProviderType() {
-        Class providerType = null;
-
         Type[] giTypes = this.serviceImplClass.getGenericInterfaces();
         for (Type giType : giTypes) {
-            ParameterizedType paramType = null;
-            try {
-                paramType = (ParameterizedType)giType;
-            } catch (ClassCastException e) {
-                throw ExceptionFactory.makeWebServiceException(
-                        "Provider based SEI Class has to implement javax.xml.ws.Provider
as javax.xml.ws.Provider<String>, javax.xml.ws.Provider<SOAPMessage>, javax.xml.ws.Provider<Source>
or javax.xml.ws.Provider<JAXBContext>");
-            }
-            Class interfaceName = (Class)paramType.getRawType();
-
-            if (interfaceName == javax.xml.ws.Provider.class) {
-                if (paramType.getActualTypeArguments().length > 1) {
-                    throw ExceptionFactory.makeWebServiceException(
-                            "Provider cannot have more than one Generic Types defined as
Per JAX-WS Specification");
+            if (giType instanceof ParameterizedType) {
+                ParameterizedType paramType = (ParameterizedType)giType;            
+                Class interfaceName = (Class)paramType.getRawType();
+                if (interfaceName == javax.xml.ws.Provider.class) {
+                    if (paramType.getActualTypeArguments().length > 1) {
+                        throw ExceptionFactory.makeWebServiceException(
+                            "Provider cannot have more than one Generic Types defined as
per JAX-WS Specification");
+                    }
                 }
-                providerType = (Class)paramType.getActualTypeArguments()[0];
+                return (Class)paramType.getActualTypeArguments()[0];                    
       
             }
         }
-        return providerType;
+        throw ExceptionFactory.makeWebServiceException(
+            "Provider has to implement javax.xml.ws.Provider interface as javax.xml.ws.Provider<DataSource>,
javax.xml.ws.Provider<SOAPMessage>, javax.xml.ws.Provider<Source> or javax.xml.ws.Provider<JAXBContext>");
     }
     
 }



Mime
View raw message