geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r158021 - geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis
Date Fri, 18 Mar 2005 04:36:38 GMT
Author: dblevins
Date: Thu Mar 17 20:36:36 2005
New Revision: 158021

URL: http://svn.apache.org/viewcvs?view=rev&rev=158021
Log:
Pojo message flow

Added:
    geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/POJOProvider.java
Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/ReadOnlyServiceDesc.java
    geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisWebServiceContainerTest.java

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&r1=158020&r2=158021
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Thu Mar 17 20:36:36 2005
@@ -32,6 +32,7 @@
 import javax.wsdl.extensions.soap.SOAPBinding;
 import javax.xml.namespace.QName;
 import javax.xml.rpc.handler.HandlerInfo;
+import javax.xml.rpc.holders.IntHolder;
 
 import net.sf.cglib.core.DefaultGeneratorStrategy;
 import net.sf.cglib.proxy.Callback;
@@ -51,8 +52,11 @@
 import org.apache.axis.soap.SOAPConstants;
 import org.apache.axis.providers.java.RPCProvider;
 import org.apache.axis.handlers.soap.SOAPService;
+import org.apache.axis.MessageContext;
+import org.apache.axis.Handler;
 import org.apache.geronimo.axis.client.*;
 import org.apache.geronimo.axis.server.AxisWebServiceContainer;
+import org.apache.geronimo.axis.server.POJOProvider;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.gbean.GBeanData;
@@ -87,7 +91,15 @@
         PortInfo portInfo = (PortInfo) portInfoObject;
 
         JavaServiceDesc serviceDesc = AxisServiceBuilder.createServiceDesc(portInfo, classLoader);
-        RPCProvider provider = new RPCProvider();
+
+        Class pojoClass = null;
+        try {
+            pojoClass = classLoader.loadClass(seiClassName);
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException("Unable to load servlet class for pojo webservice:
"+seiClassName, e);
+        }
+
+        RPCProvider provider = new POJOProvider(pojoClass);
         SOAPService service = new SOAPService(null, provider, null);
         service.setServiceDescription(serviceDesc);
         service.setOption("className", seiClassName);

Added: 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?view=auto&rev=158021
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/POJOProvider.java
(added)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/POJOProvider.java
Thu Mar 17 20:36:36 2005
@@ -0,0 +1,38 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.axis.server;
+
+import javax.xml.rpc.holders.IntHolder;
+
+import org.apache.axis.providers.java.RPCProvider;
+import org.apache.axis.MessageContext;
+import org.apache.axis.Handler;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class POJOProvider extends RPCProvider {
+    private final Class pojoClass;
+
+    public POJOProvider(Class pojoClass) {
+        this.pojoClass = pojoClass;
+    }
+
+    public Object getServiceObject(MessageContext msgContext, Handler service, String clsName,
IntHolder scopeHolder) throws Exception {
+        return pojoClass.newInstance();
+    }
+}

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/ReadOnlyServiceDesc.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/ReadOnlyServiceDesc.java?view=diff&r1=158020&r2=158021
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/ReadOnlyServiceDesc.java
(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/ReadOnlyServiceDesc.java
Thu Mar 17 20:36:36 2005
@@ -18,15 +18,14 @@
 
 import java.util.ArrayList;
 import java.util.List;
-
 import javax.xml.namespace.QName;
 
+import org.apache.axis.constants.Style;
+import org.apache.axis.constants.Use;
 import org.apache.axis.description.JavaServiceDesc;
 import org.apache.axis.description.OperationDesc;
 import org.apache.axis.encoding.TypeMapping;
 import org.apache.axis.encoding.TypeMappingRegistry;
-import org.apache.axis.constants.Style;
-import org.apache.axis.constants.Use;
 
 /**
  * @version $Rev$ $Date$
@@ -50,10 +49,10 @@
         return serviceDesc.getStopClasses();
     }
 
-    public void setStopClasses(ArrayList stopClasses) {        }
+    public void setStopClasses(ArrayList stopClasses) {
+    }
 
-    public void loadServiceDescByIntrospection()
-    {
+    public void loadServiceDescByIntrospection() {
         serviceDesc.loadServiceDescByIntrospection();
     }
 
@@ -61,8 +60,7 @@
         serviceDesc.loadServiceDescByIntrospection(implClass);
     }
 
-    public void loadServiceDescByIntrospection(Class cls, TypeMapping tm)
-    {
+    public void loadServiceDescByIntrospection(Class cls, TypeMapping tm) {
         serviceDesc.loadServiceDescByIntrospection(cls, tm);
     }
 
@@ -125,7 +123,7 @@
         return serviceDesc.getOperations();
     }
 
-    public OperationDesc [] getOperationsByName(String methodName) {
+    public OperationDesc[] getOperationsByName(String methodName) {
         return serviceDesc.getOperationsByName(methodName);
     }
 
@@ -137,7 +135,7 @@
         return serviceDesc.getOperationByElementQName(qname);
     }
 
-    public OperationDesc [] getOperationsByQName(QName qname) {
+    public OperationDesc[] getOperationsByQName(QName qname) {
         return serviceDesc.getOperationsByQName(qname);
     }
 
@@ -187,4 +185,5 @@
 
     public void setDisallowedMethods(List disallowedMethods) {
     }
+
 }

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisWebServiceContainerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisWebServiceContainerTest.java?view=diff&r1=158020&r2=158021
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisWebServiceContainerTest.java
(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisWebServiceContainerTest.java
Thu Mar 17 20:36:36 2005
@@ -35,6 +35,7 @@
 import org.apache.axis.providers.java.RPCProvider;
 import org.apache.geronimo.axis.server.AxisWebServiceContainer;
 import org.apache.geronimo.axis.server.ReadOnlyServiceDesc;
+import org.apache.geronimo.axis.server.POJOProvider;
 import org.apache.geronimo.axis.testData.echosample.EchoBean;
 
 //import org.openejb.deployment.OpenEJBModuleBuilder;
@@ -84,7 +85,8 @@
         serviceDesc.getOperations();
         ReadOnlyServiceDesc sd = new ReadOnlyServiceDesc(serviceDesc);
 
-        RPCProvider provider = new RPCProvider();
+        Class pojoClass = cl.loadClass("org.apache.geronimo.axis.testData.echosample.EchoBean");
+        RPCProvider provider = new POJOProvider(pojoClass);
         SOAPService service = new SOAPService(null, provider, null);
         service.setServiceDescription(serviceDesc);
         service.setOption("className","org.apache.geronimo.axis.testData.echosample.EchoBean");



Mime
View raw message