geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r418084 - in /geronimo/sandbox/servlet-2.5: ./ configs/jetty-deployer/src/plan/ etc/ modules/j2ee-schema/src/java/org/apache/geronimo/schema/ modules/jetty-builder/ modules/jetty/ modules/jetty/src/java/org/apache/geronimo/jetty/ modules/je...
Date Thu, 29 Jun 2006 17:02:57 GMT
Author: janb
Date: Thu Jun 29 10:02:56 2006
New Revision: 418084

URL: http://svn.apache.org/viewvc?rev=418084&view=rev
Log:
jetty and jetty-builder modules compile and the tests work except for security, as the SecurityHandler
and other BeforeAfter
interceptors have not been brought into line with jetty6; can't build console-jetty as there
is something wrong with the schema conversion

Modified:
    geronimo/sandbox/servlet-2.5/configs/jetty-deployer/src/plan/plan.xml
    geronimo/sandbox/servlet-2.5/etc/explicit_versions.properties
    geronimo/sandbox/servlet-2.5/etc/project.properties
    geronimo/sandbox/servlet-2.5/maven.xml
    geronimo/sandbox/servlet-2.5/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
    geronimo/sandbox/servlet-2.5/modules/jetty-builder/project.xml
    geronimo/sandbox/servlet-2.5/modules/jetty/project.xml
    geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
    geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyThreadPool.java
    geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
    geronimo/sandbox/servlet-2.5/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java

Modified: geronimo/sandbox/servlet-2.5/configs/jetty-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/configs/jetty-deployer/src/plan/plan.xml?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/configs/jetty-deployer/src/plan/plan.xml (original)
+++ geronimo/sandbox/servlet-2.5/configs/jetty-deployer/src/plan/plan.xml Thu Jun 29 10:02:56
2006
@@ -75,7 +75,7 @@
 
     <gbean name="StaticContent" class="org.apache.geronimo.jetty.JettyDefaultServletHolder">
         <attribute name="servletName">default</attribute>
-        <attribute name="servletClass">org.mortbay.jetty.servlet.Default</attribute>
+        <attribute name="servletClass">org.mortbay.jetty.servlet.DefaultServlet</attribute>
         <attribute name="loadOnStartup">0</attribute>
         <attribute name="initParams">
  acceptRanges=true

Modified: geronimo/sandbox/servlet-2.5/etc/explicit_versions.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/etc/explicit_versions.properties?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/etc/explicit_versions.properties (original)
+++ geronimo/sandbox/servlet-2.5/etc/explicit_versions.properties Thu Jun 29 10:02:56 2006
@@ -60,7 +60,7 @@
 jdbm///=0.20-dev
 jdom///=1.0
 jelly_velocity_tags///=1.0
-jetty///=5.1.10
+jetty///=6.0-SNAPSHOT
 jstl///=1.1.1
 juddi///=0.9rc4
 junit///=3.8.1

Modified: geronimo/sandbox/servlet-2.5/etc/project.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/etc/project.properties?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/etc/project.properties (original)
+++ geronimo/sandbox/servlet-2.5/etc/project.properties Thu Jun 29 10:02:56 2006
@@ -161,7 +161,7 @@
 jdbm_version=0.20-dev
 jdom_version=1.0
 jelly_velocity_tags_version=1.0
-jetty_version=6.0.0beta17
+jetty_version=6.0-SNAPSHOT
 jstl_version=1.1.1
 juddi_version=0.9rc4
 junit_version=3.8.1

Modified: geronimo/sandbox/servlet-2.5/maven.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/maven.xml?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/maven.xml (original)
+++ geronimo/sandbox/servlet-2.5/maven.xml Thu Jun 29 10:02:56 2006
@@ -56,7 +56,7 @@
 
     <goal name="new4">
         <maven:reactor basedir="${basedir}" includes="configs/*/project.xml"
-            excludes="configs/console-tomcat/project.xml,configs/daytrader-tomcat/project.xml,configs/jsp-examples-tomcat/project.xml,configs/ldap-demo-tomcat/project.xml,configs/remote-deploy-tomcat/project.xml,configs/servlets-examples-tomcat/project.xml,configs/uddi-tomcat/project.xml,configs/welcome-tomcat/project.xml"
goals="multiproject:install-callback" banner="configurations" ignoreFailures="false" />
+            excludes="configs/console-jetty/project.xml,configs/console-tomcat/project.xml,configs/daytrader-tomcat/project.xml,configs/jsp-examples-tomcat/project.xml,configs/ldap-demo-tomcat/project.xml,configs/remote-deploy-tomcat/project.xml,configs/servlets-examples-tomcat/project.xml,configs/uddi-tomcat/project.xml,configs/welcome-tomcat/project.xml"
goals="multiproject:install-callback" banner="configurations" ignoreFailures="false" />
     </goal>
 
     <goal name="new5">

Modified: geronimo/sandbox/servlet-2.5/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
(original)
+++ geronimo/sandbox/servlet-2.5/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
Thu Jun 29 10:02:56 2006
@@ -90,7 +90,7 @@
         XmlCursor cursor = xmlObject.newCursor();
         XmlCursor moveable = xmlObject.newCursor();
         String schemaLocationURL = "http://java.sun.com/xml/ns/javaee/application_5.xsd";
-        String version = "1.4";
+        String version = "5";
         try {
             convertToSchema(cursor, JAVAEE_NAMESPACE, schemaLocationURL, version);
             cursor.toStartDoc();
@@ -118,7 +118,7 @@
         }
         XmlCursor cursor = xmlObject.newCursor();
         XmlCursor moveable = xmlObject.newCursor();
-        String schemaLocationURL = "http://java.sun.com/xml/ns/javaee/application-client_5.xsd";
+        String schemaLocationURL = "http://java.sun.com/xml/ns/javaee/application-client_5.xsd
";
         String version = "5";
         try {
             convertToSchema(cursor, JAVAEE_NAMESPACE, schemaLocationURL, version);

Modified: geronimo/sandbox/servlet-2.5/modules/jetty-builder/project.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/modules/jetty-builder/project.xml?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/modules/jetty-builder/project.xml (original)
+++ geronimo/sandbox/servlet-2.5/modules/jetty-builder/project.xml Thu Jun 29 10:02:56 2006
@@ -258,7 +258,7 @@
         <!-- these are just needed to run the unit tests -->
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_2.4_spec</artifactId>
+            <artifactId>geronimo-servlet_2.5_spec</artifactId>
             <version>${geronimo_spec_servlet_version}</version>
         </dependency>
 

Modified: geronimo/sandbox/servlet-2.5/modules/jetty/project.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/modules/jetty/project.xml?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/modules/jetty/project.xml (original)
+++ geronimo/sandbox/servlet-2.5/modules/jetty/project.xml Thu Jun 29 10:02:56 2006
@@ -56,6 +56,12 @@
 
         <dependency>
             <groupId>geronimo</groupId>
+            <artifactId>geronimo-core</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
             <artifactId>geronimo-naming</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
@@ -170,7 +176,7 @@
         <!-- these are just needed to run the unit tests -->
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_2.4_spec</artifactId>
+            <artifactId>geronimo-servlet_2.5_spec</artifactId>
             <version>${geronimo_spec_servlet_version}</version>
         </dependency>
 
@@ -244,39 +250,6 @@
             <artifactId>commons-el</artifactId>
             <version>${commons_el_version}</version>
             <url>http://jakarta.apache.org/commons/el/</url>
-            <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
-        </dependency>
-        <dependency>
-            <groupId>springframework</groupId>
-            <artifactId>spring</artifactId>
-            <version>${wadi_spring_version}</version>
-            <url>http://www.springframework.org/</url>
-            <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
-        </dependency>
-        <dependency>
-            <groupId>activecluster</groupId>
-            <artifactId>activecluster</artifactId>
-            <version>${wadi_activecluster_version}</version>
-            <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
-        </dependency>
-        <dependency>
-            <groupId>wadi</groupId>
-            <artifactId>wadi-core</artifactId>
-            <version>${wadi_version}</version>
-            <properties>
-                 <geronimo.dependency>true</geronimo.dependency>
-             </properties>
-        </dependency>
-        <dependency>
-            <groupId>wadi</groupId>
-            <artifactId>wadi-jetty5</artifactId>
-            <version>${wadi_version}</version>
             <properties>
                  <geronimo.dependency>true</geronimo.dependency>
              </properties>

Modified: geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
(original)
+++ geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
Thu Jun 29 10:02:56 2006
@@ -31,11 +31,18 @@
 import org.apache.geronimo.webservices.SoapHandler;
 import org.apache.geronimo.webservices.WebServiceContainer;
 import org.mortbay.jetty.handler.ContextHandler;
+import org.mortbay.jetty.handler.ContextHandlerCollection;
+import org.mortbay.jetty.handler.DefaultHandler;
+import org.mortbay.jetty.handler.HandlerCollection;
+import org.mortbay.jetty.handler.RequestLogHandler;
 import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.RequestLog;
 import org.mortbay.jetty.security.UserRealm;
 import org.mortbay.jetty.Server;
 
+
+
 /**
  * @version $Rev$ $Date$
  */
@@ -46,10 +53,32 @@
     private final WebManager manager;
     private JettyWebContainerStatsImpl stats;
     private final Map realms = new HashMap();
+    private HandlerCollection handlerCollection = new HandlerCollection();
+    private ContextHandlerCollection  contextHandlerCollection = new ContextHandlerCollection();
+    private DefaultHandler defaultHandler = new DefaultHandler();
+    private RequestLogHandler requestLogHandler = new RequestLogHandler();
 
     public JettyContainerImpl(String objectName, WebManager manager) {
         this.objectName = objectName;
         server = new JettyServer();
+        
+        //set up the new jetty6 handler structure which is to have a HandlerCollection,
+        //each element of which is always tried on each request.
+        //The first element of the HandlerCollection is a 
+        //ContextHandlerCollection, which is itself is a collection
+        //of Handlers. It's special property is that only of it's
+        //handlers will respond to a request.
+        //The second element of the HandlerCollection is a DefaultHandler
+        //which is responsible for serving static content or anything not
+        //handled by a Handler in the ContextHandlerCollection.
+        //The third element is the RequestLogHandler, which requires
+        //a RequestLog impl to be set.
+        Handler[] handlers = new Handler[3];
+        handlers[0] = contextHandlerCollection;
+        handlers[1] = defaultHandler;
+        handlers[2] = requestLogHandler;
+        server.setHandler(handlerCollection);
+
         stats = new JettyWebContainerStatsImpl();
         this.manager = manager;
     }
@@ -183,7 +212,9 @@
     public void addWebService(String contextPath, String[] virtualHosts, WebServiceContainer
webServiceContainer, String securityRealmName, String realmName, String transportGuarantee,
String authMethod, ClassLoader classLoader) throws Exception {
         InternalJAASJettyRealm internalJAASJettyRealm = securityRealmName == null? null:addRealm(securityRealmName);
         JettyEJBWebServiceContext webServiceContext = new JettyEJBWebServiceContext(contextPath,
webServiceContainer, internalJAASJettyRealm, realmName, transportGuarantee, authMethod, classLoader);
-        webServiceContext.setHosts(virtualHosts);
+        System.err.println("virtualHosts==null?"+virtualHosts);
+        
+        webServiceContext.setConnectors(virtualHosts);
         addContext(webServiceContext);
         webServiceContext.start();
         webServices.put(contextPath, webServiceContext);
@@ -203,13 +234,12 @@
     }
 
     public void setRequestLog(RequestLog log) {
-      //TODO: need to do this the jetty6 way with the right handler collection setup
+      this.requestLogHandler.setRequestLog(log);
     }
 
     /* ------------------------------------------------------------ */
     public RequestLog getRequestLog() {
-      //TODO: need to do this the jetty6 way with the right handler collection setup
-        return null;
+        return this.requestLogHandler.getRequestLog();
     }
 
     public void doStart() throws Exception {

Modified: geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyThreadPool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyThreadPool.java?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyThreadPool.java
(original)
+++ geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyThreadPool.java
Thu Jun 29 10:02:56 2006
@@ -4,24 +4,28 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-public class JettyThreadPool extends org.apache.geronimo.pool.ThreadPool  implements ThreadPool{
+/**
+ * JettyThreadPool
+ * 
+ * Class to implement Jetty org.mortbay.jetty.thread.ThreadPool interface
+ * and delegate to a Geronimo thread pool impl.
+ *
+ */
+public class JettyThreadPool implements ThreadPool {
 
     private final static Log log = LogFactory.getLog(JettyThreadPool.class);
-    private final static long WAIT_TIME = 5000L;
-    private boolean isStarted = false;
-    private boolean isFailed = false;
-    private Object joinLock = new Object();
+    private org.apache.geronimo.pool.ThreadPool geronimoThreadPool;
     
    
     
-    public JettyThreadPool(int poolSize, String poolName, long keepAliveTime, ClassLoader
classLoader, String objectName) {
-        super(poolSize, poolName, keepAliveTime, classLoader, objectName);
+    public JettyThreadPool(org.apache.geronimo.pool.ThreadPool geronimoThreadPool) {
+        this.geronimoThreadPool = geronimoThreadPool;
     }
 
     
     public boolean dispatch(Runnable work) {
         try {
-            execute(work);
+            this.geronimoThreadPool.execute(work);
             return true;
         }
         catch (InterruptedException e) {
@@ -37,62 +41,21 @@
      * @see org.mortbay.thread.ThreadPool#join()
      */
     public void join() throws InterruptedException {
-        synchronized (joinLock)
-        {
-            while (isRunning())
-                joinLock.wait(WAIT_TIME);
-        }
+        throw new UnsupportedOperationException("join not supported");
     }
 
     public int getThreads() {
-        return getPoolSize();
+        return this.geronimoThreadPool.getPoolSize();
     }
 
     public int getIdleThreads() {
-        //TODO: use geronimoPool.getStats() to statisfy this?
+        //TODO: not supported in geronimo thread pool
         return 0;
     }
 
     public boolean isLowOnThreads() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public void start() throws Exception {
-        doStart();
-        isStarted = true;
-    }
-
-    public void stop() throws Exception {
-        doStop();
-        isStarted = false;
-    }
-
-    public boolean isRunning() {
-        return isStarted;
-    }
-
-    public boolean isStarted() {
-        return isStarted;
-    }
-
-    public boolean isStarting() {
-        // TODO:
-        return false;
-    }
-
-    public boolean isStopping() {
-        // TODO: 
+        // TODO: not supported in geronimo thread pool
         return false;
     }
-
-    public boolean isFailed() {
-        return isFailed;
-    }
-
-    public void doFail ()
-    {
-        super.doFail();
-        isFailed = true;
-    }
+    
 }

Modified: geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
(original)
+++ geronimo/sandbox/servlet-2.5/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Thu Jun 29 10:02:56 2006
@@ -198,11 +198,14 @@
 
 
         webAppRoot = configurationBaseUrl.toString();
+        
+        System.err.println("WEBAPP ROOT = "+webAppRoot);
+        
         this.webClassLoader = classLoader;
         this.webAppContext.setClassLoader(this.webClassLoader);
 
         if (host != null) {
-            this.webAppContext.setHosts(host.getHosts());
+            this.webAppContext.setConnectors(host.getHosts());
             this.webAppContext.setVirtualHosts(host.getVirtualHosts());
         }
 
@@ -324,6 +327,10 @@
         }
     }
     
+    public void setContextPath (String path) {
+        this.webAppContext.setContextPath(path);
+    }
+    
     public String getContextPath () {
         return this.webAppContext.getContextPath();
     }
@@ -348,12 +355,7 @@
         // reset the classsloader... jetty likes to set it to null when stopping
         this.webAppContext.setClassLoader(webClassLoader);
 
-        // merge Geronimo and Jetty Lifecycles
-        if (!this.webAppContext.isStarting()) {
-            this.webAppContext.start();
-            return;
-        }
-
+        System.err.println("Setting war to be: "+webAppRoot.toString());
 
         this.webAppContext.setWar(webAppRoot.toString());
 

Modified: geronimo/sandbox/servlet-2.5/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/servlet-2.5/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java?rev=418084&r1=418083&r2=418084&view=diff
==============================================================================
--- geronimo/sandbox/servlet-2.5/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
(original)
+++ geronimo/sandbox/servlet-2.5/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
Thu Jun 29 10:02:56 2006
@@ -37,7 +37,7 @@
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
-import org.mortbay.http.Authenticator;
+import org.mortbay.jetty.security.Authenticator;
 import org.mortbay.jetty.security.FormAuthenticator;
 
 import java.net.URL;
@@ -73,7 +73,7 @@
 
         new JettyServletHolder("test:name=staticservlet",
                 "default",
-                "org.mortbay.jetty.servlet.Default",
+                "org.mortbay.jetty.servlet.DefaultServlet",
                 null,
                 staticContentServletInitParams,
                 null,



Mime
View raw message