geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r157992 - in geronimo/trunk/modules: axis-builder/ axis-builder/src/java/org/apache/geronimo/axis/builder/ axis/src/java/org/apache/geronimo/axis/server/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ jetty-builder/src/java/org/apache/geronimo/jetty/deployment/ jetty/src/java/org/apache/geronimo/jetty/ jetty/src/test/org/apache/geronimo/jetty/app/ webservices/src/java/org/apache/geronimo/webservices/
Date Thu, 17 Mar 2005 23:54:19 GMT
Author: dblevins
Date: Thu Mar 17 15:54:16 2005
New Revision: 157992

URL: http://svn.apache.org/viewcvs?view=rev&rev=157992
Log:
Delay deserialization of WebServiceContainer till gbean startup.  Make webclassloader available
from JettyServletRegistration.

Modified:
    geronimo/trunk/modules/axis-builder/project.xml
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
    geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java
    geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyEJBWebServiceContext.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/POJOWebServiceServlet.java
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceContainer.java
    geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceContainer.java

Modified: geronimo/trunk/modules/axis-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/project.xml?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/axis-builder/project.xml (original)
+++ geronimo/trunk/modules/axis-builder/project.xml Thu Mar 17 15:54:16 2005
@@ -49,13 +49,6 @@
             <type>plugin</type>
         </dependency>
 
-<!--
-        <dependency>
-            <groupId>openejb</groupId>
-            <artifactId>openejb-core</artifactId>
-            <version>${openejb_version}</version>
-        </dependency>
--->
         <!-- needed for xmlbeans runtime-->
         <dependency>
             <groupId>xmlbeans</groupId>
@@ -85,6 +78,18 @@
         <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-axis</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-webservices</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
 

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=157991&r2=157992
==============================================================================
--- 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 15:54:16 2005
@@ -63,6 +63,9 @@
 import org.apache.geronimo.j2ee.deployment.POJOWebServiceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.ClassLoading;
+import org.apache.geronimo.kernel.ObjectInputStreamExt;
+import org.apache.geronimo.kernel.ClassLoaderReference;
+import org.apache.geronimo.kernel.StoredObject;
 import org.apache.geronimo.naming.reference.DeserializingReference;
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingType;
 import org.apache.geronimo.xbeans.j2ee.JavaXmlTypeMappingType;
@@ -80,11 +83,9 @@
 
 
     //WebServiceBuilder
-    public void configurePOJO(GBeanData targetGBean, Object portInfoObject, String seiClassName)
throws DeploymentException {
+    public void configurePOJO(GBeanData targetGBean, Object portInfoObject, String seiClassName,
ClassLoader classLoader) throws DeploymentException {
         PortInfo portInfo = (PortInfo) portInfoObject;
-        System.out.println("NOT CONFIGURING WEB SERVICE " + portInfo.getPortComponentName());
 
-        ClassLoader classLoader = this.getClass().getClassLoader(); // TODO need the actual
classloader
         JavaServiceDesc serviceDesc = AxisServiceBuilder.createServiceDesc(portInfo, classLoader);
         RPCProvider provider = new RPCProvider();
         SOAPService service = new SOAPService(null, provider, null);
@@ -105,8 +106,14 @@
             throw new DeploymentException("Invalid webservice endpoint URI", e);
         }
 
+        classLoader = new ClassLoaderReference(classLoader);
         AxisWebServiceContainer axisWebServiceContainer = new AxisWebServiceContainer(location,
wsdlURL, service, classLoader);
-        targetGBean.setAttribute("webServiceContainer", axisWebServiceContainer);
+        //targetGBean.setAttribute("webServiceContainer", axisWebServiceContainer);
+        try {
+            targetGBean.setAttribute("webServiceContainer", new StoredObject(axisWebServiceContainer));
// Hack!
+        } catch (IOException e) {
+            throw new DeploymentException("Unable to serialize the AxisWebServiceContainer",
e);
+        }
     }
 
     public void configureEJB(GBeanData targetGBean, Object portInfoObject, String seiClassName)
throws DeploymentException {

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
Thu Mar 17 15:54:16 2005
@@ -351,7 +351,7 @@
             if (!wsdlMessageQName.equals(output.getQName())) {
                 throw new DeploymentException("QName of output message: " + output.getQName()
+
                         " does not match mapping message QName: " + wsdlMessageQName + "
for operation " + operationName);
-            }
+             }
             part = output.getPart(wsdlMessagePartName);
             if (part == null) {
                 throw new DeploymentException("No part for wsdlMessagePartName " + wsdlMessagePartName
+ " in output message for operation " + operationName);
@@ -375,4 +375,17 @@
         ParameterDesc parameterDesc = new ParameterDesc(partQName, mode, partTypeQName, actualParamJavaType,
inHeader, outHeader);
         return parameterDesc;
     }
+
+    /**
+     * Supporting the Document/Literal Wrapped pattern
+     *
+     * See http://www-106.ibm.com/developerworks/webservices/library/ws-whichwsdl/ for a
nice explanation and example
+     * 
+     * wrapped-element tag is used
+     * WSDL message with a single part
+     * part uses the 'element' attribute to point to an elemement in the types section
+     * the element type and the element's name match the operation name
+     */
+
+
 }

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
Thu Mar 17 15:54:16 2005
@@ -173,7 +173,8 @@
         return responseMessage;
     }
 
-    public void getWsdl(OutputStream out) throws Exception {
+    public void getWsdl(Request req, Response res) throws Exception {
+        OutputStream out = res.getOutputStream();
         InputStream in = null;
         try {
             in = wsdlURL.openStream();

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java
Thu Mar 17 15:54:16 2005
@@ -34,7 +34,7 @@
      * @param seiClassName
      * @throws DeploymentException
      */
-    void configurePOJO(GBeanData targetGBean, Object portInfo, String seiClassName) throws
DeploymentException;
+    void configurePOJO(GBeanData targetGBean, Object portInfo, String seiClassName, ClassLoader
classLoader) throws DeploymentException;
 
     /**
      * configure the supplied EJBContainer gbeandata to implement the ejb web service described
in the deployment descriptor

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Thu Mar 17 15:54:16 2005
@@ -772,7 +772,7 @@
                 if (portInfo == null) {
                     throw new DeploymentException("No web service deployment info for servlet
name " + servletName);
                 }
-                pojoWebServiceBuilder.configurePOJO(servletData, portInfo, servletClassName);
+                pojoWebServiceBuilder.configurePOJO(servletData, portInfo, servletClassName,
webClassLoader);
             }
         } else if (servletType.isSetJspFile()) {
             servletData = new GBeanData(servletObjectName, JettyServletHolder.GBEAN_INFO);

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyEJBWebServiceContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyEJBWebServiceContext.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyEJBWebServiceContext.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyEJBWebServiceContext.java
Thu Mar 17 15:54:16 2005
@@ -86,7 +86,7 @@
         response.setContentType("text/xml");
 
         if (request.getParameter("wsdl") != null) {
-            doGetWsdl(response);
+            doGetWsdl(request, response);
         } else {
             doInvoke(request, response);
         }
@@ -104,10 +104,9 @@
         }
     }
 
-    private void doGetWsdl(HttpResponse response) throws IOException {
-        OutputStream out = response.getOutputStream();
+    private void doGetWsdl(HttpRequest request, HttpResponse response) throws IOException
{
         try {
-            webServiceContainer.getWsdl(out);
+            webServiceContainer.getWsdl(new RequestAdapter(request), new ResponseAdapter(response));
         } catch (IOException e) {
             throw e;
         } catch (Exception e) {

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
Thu Mar 17 15:54:16 2005
@@ -16,12 +16,16 @@
  */
 package org.apache.geronimo.jetty;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
 import java.util.Map;
 import java.util.Set;
 import java.util.Collections;
+import java.security.SignedObject;
+import java.security.PrivateKey;
+import java.security.Signature;
+import java.security.InvalidKeyException;
+import java.security.SignatureException;
+import java.security.PublicKey;
 import javax.security.jacc.PolicyContext;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
@@ -29,11 +33,15 @@
 import javax.servlet.UnavailableException;
 import javax.servlet.Servlet;
 import javax.servlet.ServletConfig;
+import javax.crypto.SealedObject;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.kernel.ObjectInputStreamExt;
+import org.apache.geronimo.kernel.StoredObject;
 import org.mortbay.jetty.servlet.ServletHolder;
 import org.mortbay.jetty.servlet.ServletHttpRequest;
 
@@ -44,8 +52,10 @@
  *
  * @version $Rev: 154436 $ $Date: 2005-02-19 10:22:02 -0800 (Sat, 19 Feb 2005) $
  */
-public class JettyPOJOWebServiceHolder extends ServletHolder {
+public class JettyPOJOWebServiceHolder extends ServletHolder implements GBeanLifecycle {
     private WebServiceContainer webServiceContainer;
+    private StoredObject storedWebServiceContainer;
+    private ClassLoader webClassLoader;
 
     //todo consider interface instead of this constructor for endpoint use.
     public JettyPOJOWebServiceHolder() {
@@ -57,13 +67,14 @@
                               Integer loadOnStartup,
                               Set servletMappings,
                               Map webRoleRefPermissions,
-                              WebServiceContainer webServiceContainer,
+                              StoredObject storedWebServiceContainer,
                               JettyServletRegistration context) throws Exception {
         super(context == null? null: context.getServletHandler(), servletName, POJOWebServiceServlet.class.getName(),
null);
         //context will be null only for use as "default servlet info holder" in deployer.
 
-        this.webServiceContainer = webServiceContainer;
+        this.storedWebServiceContainer = storedWebServiceContainer;
         if (context != null) {
+            this.webClassLoader = context.getWebClassLoader();
             putAll(initParams);
             if (loadOnStartup != null) {
                 setInitOrder(loadOnStartup.intValue());
@@ -109,7 +120,7 @@
         infoBuilder.addAttribute("loadOnStartup", Integer.class, true);
         infoBuilder.addAttribute("servletMappings", Set.class, true);
         infoBuilder.addAttribute("webRoleRefPermissions", Map.class, true);
-        infoBuilder.addAttribute("webServiceContainer", WebServiceContainer.class, true);
+        infoBuilder.addAttribute("webServiceContainer", StoredObject.class, true);
         infoBuilder.addReference("JettyServletRegistration", JettyServletRegistration.class);
 
         infoBuilder.setConstructor(new String[] {"servletName",
@@ -126,4 +137,19 @@
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
+
+    public void doStart() throws Exception {
+        if (webClassLoader != null){
+            webServiceContainer = (WebServiceContainer) storedWebServiceContainer.getObject(webClassLoader);
+        }
+    }
+
+    public void doStop() throws Exception {
+    }
+
+    public void doFail() {
+    }
+
+
+
 }

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java
Thu Mar 17 15:54:16 2005
@@ -32,4 +32,6 @@
 
     ServletHandler getServletHandler();
 
+    ClassLoader getWebClassLoader();
+
 }

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Thu Mar 17 15:54:16 2005
@@ -268,6 +268,11 @@
         chain.after(context, httpRequest, httpResponse);
     }
 
+
+    public ClassLoader getWebClassLoader() {
+        return webClassLoader;
+    }
+
     public void doStart() throws Exception {
         // reset the classsloader... jetty likes to set it to null when stopping
         setClassLoader(webClassLoader);

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/POJOWebServiceServlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/POJOWebServiceServlet.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/POJOWebServiceServlet.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/POJOWebServiceServlet.java
Thu Mar 17 15:54:16 2005
@@ -57,6 +57,7 @@
  */
 public class POJOWebServiceServlet implements Servlet {
     public static final String WEBSERVICE_CONTAINER = "webServiceContainer";
+    public static final String WEBSERVICE_CONTAINER_BYTES = "webServiceContainerBytes";
 
     public void init(ServletConfig config) throws ServletException {
 

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceContainer.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceContainer.java
(original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceContainer.java
Thu Mar 17 15:54:16 2005
@@ -33,7 +33,7 @@
         response.getOutputStream().write("Hello World".getBytes());
     }
 
-    public void getWsdl(OutputStream out) throws Exception {
+    public void getWsdl(Request req, Response res) throws Exception {
 
     }
 

Modified: geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceContainer.java?view=diff&r1=157991&r2=157992
==============================================================================
--- geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceContainer.java
(original)
+++ geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceContainer.java
Thu Mar 17 15:54:16 2005
@@ -19,6 +19,7 @@
 import java.io.OutputStream;
 import java.io.InputStream;
 import java.io.IOException;
+import java.io.Serializable;
 import java.net.URI;
 import java.net.URL;
 import java.util.Map;
@@ -26,11 +27,11 @@
 /**
  * @version $Rev:  $ $Date:  $
  */
-public interface WebServiceContainer {
+public interface WebServiceContainer extends Serializable {
 
     void invoke(Request request, Response response) throws Exception;
 
-    void getWsdl(OutputStream out) throws Exception;
+    void getWsdl(Request req, Response res) throws Exception;
 
     public interface Request {
         /** the HTTP OPTIONS type */



Mime
View raw message