geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r154910 - in geronimo/trunk/modules: jetty/src/java/org/apache/geronimo/jetty/ jetty/src/test/org/apache/geronimo/jetty/app/ webservices/src/java/org/apache/geronimo/webservices/
Date Tue, 22 Feb 2005 23:15:35 GMT
Author: djencks
Date: Tue Feb 22 15:15:32 2005
New Revision: 154910

URL: http://svn.apache.org/viewcvs?view=rev&rev=154910
Log:
hook the ejb ws up to jetty

Added:
    geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceContainer.java
Modified:
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
    geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceInvoker.java

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java?view=diff&r1=154909&r2=154910
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java Tue
Feb 22 15:15:32 2005
@@ -19,9 +19,8 @@
 
 import org.mortbay.http.HttpContext;
 import org.mortbay.http.HttpListener;
-import org.mortbay.http.UserRealm;
 import org.mortbay.http.RequestLog;
-import org.apache.geronimo.webservices.WebServiceInvoker;
+import org.mortbay.http.UserRealm;
 
 /**
  * @version $Rev$ $Date$
@@ -38,11 +37,6 @@
     void addRealm(UserRealm realm);
 
     void removeRealm(UserRealm realm);
-
-    //TODO these need to be in a separate interface, they need to be called by an ejb container
that doesn't know it this is jetty or tomcat.
-    void addWebService(String contextPath, WebServiceInvoker webServiceInvoker) throws Exception;
-
-    void removeWebService(String contextPath);
 
     void resetStatistics();
 

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java?view=diff&r1=154909&r2=154910
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
Tue Feb 22 15:15:32 2005
@@ -17,27 +17,28 @@
 
 package org.apache.geronimo.jetty;
 
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
 
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.webservices.WebServiceInvoker;
 import org.mortbay.http.HttpContext;
 import org.mortbay.http.HttpListener;
 import org.mortbay.http.RequestLog;
 import org.mortbay.http.UserRealm;
 import org.mortbay.jetty.Server;
 
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.webservices.WebServiceInvoker;
-
 /**
  * @version $Rev$ $Date$
  */
-public class JettyContainerImpl implements JettyContainer, GBeanLifecycle {
+public class JettyContainerImpl implements JettyContainer, WebServiceContainer, GBeanLifecycle
{
     private final Server server;
     private final Map webServices = new HashMap();
 
+
     public JettyContainerImpl() {
         server = new JettyServer();
     }
@@ -177,36 +178,36 @@
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("Jetty Web Container", JettyContainerImpl.class);
-        infoFactory.addAttribute("collectStatistics", Boolean.TYPE, true);
-        infoFactory.addAttribute("collectStatisticsStarted", Long.TYPE, false);
-        infoFactory.addAttribute("connections", Integer.TYPE, false);
-        infoFactory.addAttribute("connectionsOpen", Integer.TYPE, false);
-        infoFactory.addAttribute("connectionsOpenMax", Integer.TYPE, false);
-        infoFactory.addAttribute("connectionsDurationAve", Long.TYPE, false);
-        infoFactory.addAttribute("connectionsDurationMax", Long.TYPE, false);
-        infoFactory.addAttribute("connectionsRequestsAve", Integer.TYPE, false);
-        infoFactory.addAttribute("connectionsRequestsMax", Integer.TYPE, false);
-        infoFactory.addAttribute("errors", Integer.TYPE, false);
-        infoFactory.addAttribute("requests", Integer.TYPE, false);
-        infoFactory.addAttribute("requestsActive", Integer.TYPE, false);
-        infoFactory.addAttribute("requestsActiveMax", Integer.TYPE, false);
-        infoFactory.addAttribute("requestsDurationAve", Long.TYPE, false);
-        infoFactory.addAttribute("requestsDurationMax", Long.TYPE, false);
-        infoFactory.addOperation("resetStatistics");
-
-        infoFactory.addAttribute("requestLog", RequestLog.class, false);
-
-        infoFactory.addOperation("addListener", new Class[]{HttpListener.class});
-        infoFactory.addOperation("removeListener", new Class[]{HttpListener.class});
-        infoFactory.addOperation("addContext", new Class[]{HttpContext.class});
-        infoFactory.addOperation("removeContext", new Class[]{HttpContext.class});
-        infoFactory.addOperation("addRealm", new Class[]{UserRealm.class});
-        infoFactory.addOperation("removeRealm", new Class[]{UserRealm.class});
-        infoFactory.addOperation("addWebService", new Class[]{String.class, WebServiceInvoker.class});
-        infoFactory.addOperation("removeWebService", new Class[]{String.class});
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder("Jetty Web Container", JettyContainerImpl.class);
+        infoBuilder.addAttribute("collectStatistics", Boolean.TYPE, true);
+        infoBuilder.addAttribute("collectStatisticsStarted", Long.TYPE, false);
+        infoBuilder.addAttribute("connections", Integer.TYPE, false);
+        infoBuilder.addAttribute("connectionsOpen", Integer.TYPE, false);
+        infoBuilder.addAttribute("connectionsOpenMax", Integer.TYPE, false);
+        infoBuilder.addAttribute("connectionsDurationAve", Long.TYPE, false);
+        infoBuilder.addAttribute("connectionsDurationMax", Long.TYPE, false);
+        infoBuilder.addAttribute("connectionsRequestsAve", Integer.TYPE, false);
+        infoBuilder.addAttribute("connectionsRequestsMax", Integer.TYPE, false);
+        infoBuilder.addAttribute("errors", Integer.TYPE, false);
+        infoBuilder.addAttribute("requests", Integer.TYPE, false);
+        infoBuilder.addAttribute("requestsActive", Integer.TYPE, false);
+        infoBuilder.addAttribute("requestsActiveMax", Integer.TYPE, false);
+        infoBuilder.addAttribute("requestsDurationAve", Long.TYPE, false);
+        infoBuilder.addAttribute("requestsDurationMax", Long.TYPE, false);
+        infoBuilder.addOperation("resetStatistics");
+
+        infoBuilder.addAttribute("requestLog", RequestLog.class, false);
+
+        infoBuilder.addOperation("addListener", new Class[]{HttpListener.class});
+        infoBuilder.addOperation("removeListener", new Class[]{HttpListener.class});
+        infoBuilder.addOperation("addContext", new Class[]{HttpContext.class});
+        infoBuilder.addOperation("removeContext", new Class[]{HttpContext.class});
+        infoBuilder.addOperation("addRealm", new Class[]{UserRealm.class});
+        infoBuilder.addOperation("removeRealm", new Class[]{UserRealm.class});
+
+        infoBuilder.addInterface(WebServiceContainer.class);
 
-        GBEAN_INFO = infoFactory.getBeanInfo();
+        GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 
     public static GBeanInfo getGBeanInfo() {

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java?view=diff&r1=154909&r2=154910
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java
Tue Feb 22 15:15:32 2005
@@ -60,7 +60,7 @@
         if (request.getParameter("wsdl") != null) {
             OutputStream out = response.getOutputStream();
             try {
-                webServiceInvoker.getWsdl(null, out);
+                webServiceInvoker.getWsdl(out);
             } catch (IOException e) {
                 throw e;
             } catch (Exception e) {
@@ -69,7 +69,7 @@
             //WHO IS RESPONSIBLE FOR CLOSING OUT?
         } else {
             try {
-                webServiceInvoker.invoke(request.getInputStream(), response.getOutputStream());
+                webServiceInvoker.invoke(request.getInputStream(), response.getOutputStream(),
request.getURI().getPath());
                 request.setHandled(true);
             } catch (IOException e) {
                 throw e;

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java?view=diff&r1=154909&r2=154910
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
(original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
Tue Feb 22 15:15:32 2005
@@ -29,11 +29,11 @@
  * @version $Rev:  $ $Date:  $
  */
 public class MockWebServiceInvoker implements WebServiceInvoker {
-    public void invoke(InputStream in, OutputStream out) throws Exception {
+    public void invoke(InputStream in, OutputStream out, String uri) throws Exception {
         out.write("Hello World".getBytes());
     }
 
-    public void getWsdl(URI wsdlURi, OutputStream out) throws Exception {
+    public void getWsdl(OutputStream out) throws Exception {
 
     }
 

Added: 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=auto&rev=154910
==============================================================================
--- geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceContainer.java
(added)
+++ geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceContainer.java
Tue Feb 22 15:15:32 2005
@@ -0,0 +1,28 @@
+/**
+ *
+ * Copyright 2003-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.webservices;
+
+/**
+ * @version $Rev:  $ $Date:  $
+ */
+public interface WebServiceContainer {
+
+    void addWebService(String contextPath, WebServiceInvoker webServiceInvoker) throws Exception;
+
+    void removeWebService(String contextPath);
+
+}

Modified: geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceInvoker.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceInvoker.java?view=diff&r1=154909&r2=154910
==============================================================================
--- geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceInvoker.java
(original)
+++ geronimo/trunk/modules/webservices/src/java/org/apache/geronimo/webservices/WebServiceInvoker.java
Tue Feb 22 15:15:32 2005
@@ -25,7 +25,8 @@
  */
 public interface WebServiceInvoker {
 
-    void invoke(InputStream in, OutputStream out) throws Exception;
+    void invoke(InputStream in, OutputStream out, String uri) throws Exception;
+
+    void getWsdl(OutputStream out) throws Exception;
 
-    void getWsdl(URI wsdlURi, OutputStream out) throws Exception;
 }



Mime
View raw message