geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r179291 - /geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/POJOProvider.java
Date Tue, 31 May 2005 21:52:33 GMT
Author: dblevins
Date: Tue May 31 14:52:33 2005
New Revision: 179291

URL: http://svn.apache.org/viewcvs?rev=179291&view=rev
Log:
The pojo class does not need to implement the service endpoint interface.

Modified:
    geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/POJOProvider.java

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/POJOProvider.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/POJOProvider.java?rev=179291&r1=179290&r2=179291&view=diff
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/POJOProvider.java
(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/POJOProvider.java
Tue May 31 14:52:33 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.axis.server;
 
+import java.lang.reflect.Method;
 import javax.xml.rpc.holders.IntHolder;
 
 import org.apache.axis.providers.java.RPCProvider;
@@ -33,5 +34,19 @@
     public Object getServiceObject(MessageContext msgContext, Handler service, String clsName,
IntHolder scopeHolder) throws Exception {
         WebServiceContainer.Request request = (WebServiceContainer.Request) msgContext.getProperty(AxisWebServiceContainer.REQUEST);
         return request.getAttribute(WebServiceContainer.POJO_INSTANCE);
+    }
+
+
+    protected Object invokeMethod(MessageContext msgContext, Method interfaceMethod, Object
pojo, Object[] arguments) throws Exception {
+        Class pojoClass = pojo.getClass();
+
+        Method pojoMethod = null;
+        try {
+            pojoMethod = pojoClass.getMethod(interfaceMethod.getName(), interfaceMethod.getParameterTypes());
+        } catch (NoSuchMethodException e) {
+            throw new NoSuchMethodException("The pojo class '"+pojoClass.getName()+"' does
not have a method matching signature: "+interfaceMethod);
+        }
+
+        return pojoMethod.invoke(pojo, arguments);
     }
 }



Mime
View raw message