axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject svn commit: r546643 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java kernel/src/org/apache/axis2/receivers/RawXMLINOutMessageReceiver.java
Date Tue, 12 Jun 2007 21:52:48 GMT
Author: gdaniels
Date: Tue Jun 12 14:52:47 2007
New Revision: 546643

URL: http://svn.apache.org/viewvc?view=rev&rev=546643
Log:
Fix https://issues.apache.org/jira/browse/AXIS2-2732

Cache java.lang.Methods in AxisOperation.

(note - not fixing for async message receivers because of https://issues.apache.org/jira/browse/AXIS2-2800...)

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/RawXMLINOutMessageReceiver.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java?view=diff&rev=546643&r1=546642&r2=546643
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
Tue Jun 12 14:52:47 2007
@@ -76,15 +76,25 @@
             AxisMessage inAxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
             String messageNameSpace = null;
             QName elementQName;
-            String methodName = op.getName().getLocalPart();
-            Method[] methods = ImplClass.getMethods();
 
-            for (int i = 0; i < methods.length; i++) {
-                if (methods[i].getName().equals(methodName)) {
-                    method = methods[i];
-                    break;
+            method = (Method)(op.getParameterValue("myMethod"));
+            if (method == null) {
+                String methodName = op.getName().getLocalPart();
+                Method[] methods = ImplClass.getMethods();
+
+                for (int i = 0; i < methods.length; i++) {
+                    if (methods[i].getName().equals(methodName)) {
+                        method = methods[i];
+                        op.addParameter("myMethod", method);
+                        break;
+                    }
+                }
+                if (method == null) {
+                    throw new AxisFault("No such method '" + methodName +
+                            "' in class " + ImplClass.getName());
                 }
             }
+
             Object resObject = null;
             if (inAxisMessage != null) {
                 if (inAxisMessage.getElementQName() == null) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/RawXMLINOutMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/RawXMLINOutMessageReceiver.java?view=diff&rev=546643&r1=546642&r2=546643
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/RawXMLINOutMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/RawXMLINOutMessageReceiver.java
Tue Jun 12 14:52:47 2007
@@ -43,16 +43,26 @@
         implements MessageReceiver {
 
     private Method findOperation(AxisOperation op, Class implClass) {
+        Method method = (Method)(op.getParameterValue("myMethod"));
+        if (method != null) return method;
+
         String methodName = op.getName().getLocalPart();
         Method[] methods = implClass.getMethods();
 
         for (int i = 0; i < methods.length; i++) {
-            if (methods[i].getName().equals(methodName) &&
-                    methods[i].getParameterTypes().length == 1 &&
-                    OMElement.class.getName().equals(
-                            methods[i].getParameterTypes()[0].getName()) &&
-                    OMElement.class.getName().equals(methods[i].getReturnType().getName()))
{
-                return methods[i];
+            if (methods[i].getName().equals(methodName)) {
+                Class [] params = methods[i].getParameterTypes();
+                if (params.length == 1 &&
+                        OMElement.class.equals(params[0]) &&
+                        OMElement.class.equals(methods[i].getReturnType())) {
+                    method = methods[i];
+                    try {
+                        op.addParameter("myMethod", method);
+                    } catch (AxisFault axisFault) {
+                        // Do nothing here
+                    }
+                    return method;
+                }
             }
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message