geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r722538 - in /geronimo/server/trunk/plugins/jetty: ./ geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/ geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/ geronimo-jetty6/src/main/java/org/apache/geron...
Date Tue, 02 Dec 2008 17:40:24 GMT
Author: dwoods
Date: Tue Dec  2 09:40:24 2008
New Revision: 722538

URL: http://svn.apache.org/viewvc?rev=722538&view=rev
Log:
GERONIMO-4437 Upgrade to Jetty 6.1.14

Modified:
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/AbstractClusteredPreHandler.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionHandler.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/PreHandler.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/TwistyWebAppContext.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java
    geronimo/server/trunk/plugins/jetty/pom.xml

Modified: geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/AbstractClusteredPreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/AbstractClusteredPreHandler.java?rev=722538&r1=722537&r2=722538&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/AbstractClusteredPreHandler.java
(original)
+++ geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/AbstractClusteredPreHandler.java
Tue Dec  2 09:40:24 2008
@@ -25,6 +25,7 @@
 import org.apache.geronimo.clustering.ClusteredInvocation;
 import org.apache.geronimo.clustering.ClusteredInvocationException;
 import org.apache.geronimo.jetty6.AbstractPreHandler;
+import org.mortbay.component.LifeCycle;
 import org.mortbay.jetty.HttpException;
 
 /**
@@ -49,6 +50,12 @@
         }
     }
 
+    public void addLifeCycleListener(LifeCycle.Listener listener) {
+    }
+
+    public void removeLifeCycleListener(LifeCycle.Listener listener) {
+    }
+
     protected abstract ClusteredInvocation newClusteredInvocation(String target,
             HttpServletRequest request, HttpServletResponse response, int dispatch);
 

Modified: geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionHandler.java?rev=722538&r1=722537&r2=722538&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionHandler.java
(original)
+++ geronimo/server/trunk/plugins/jetty/geronimo-jetty6-clustering-wadi/src/main/java/org/apache/geronimo/jetty6/cluster/ClusteredSessionHandler.java
Tue Dec  2 09:40:24 2008
@@ -24,6 +24,7 @@
 
 import org.apache.geronimo.jetty6.AbstractPreHandler;
 import org.apache.geronimo.jetty6.PreHandler;
+import org.mortbay.component.LifeCycle;
 import org.mortbay.jetty.servlet.SessionHandler;
 
 /**
@@ -65,6 +66,12 @@
                 throws IOException, ServletException {
             doHandle(target, request, response, dispatch);
         }
+
+        public void addLifeCycleListener(LifeCycle.Listener listener) {
+        }
+
+        public void removeLifeCycleListener(LifeCycle.Listener listener) {
+        }
     }
 
 }

Modified: geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/PreHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/PreHandler.java?rev=722538&r1=722537&r2=722538&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/PreHandler.java
(original)
+++ geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/PreHandler.java
Tue Dec  2 09:40:24 2008
@@ -18,6 +18,7 @@
 package org.apache.geronimo.jetty6;
 
 import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.handler.AbstractHandler;
 
 /**
  * @version $Rev: 449059 $ $Date: 2006-09-23 05:23:09 +1000 (Sat, 23 Sep 2006) $

Modified: geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java?rev=722538&r1=722537&r2=722538&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java
(original)
+++ geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java
Tue Dec  2 09:40:24 2008
@@ -18,16 +18,20 @@
 
 package org.apache.geronimo.jetty6.handler;
 
+import org.mortbay.component.LifeCycle;
 import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.HandlerContainer;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.handler.AbstractHandler;
 import org.mortbay.jetty.handler.AbstractHandlerContainer;
+import org.mortbay.util.LazyList;
 
 /**
  * @version $Rev$ $Date$
  */
 public abstract class AbstractImmutableHandler implements Handler /*extends AbstractHandlerContainer*/
{
+    private Object _lock = new Object();
+    protected LifeCycle.Listener[] _listeners;
     protected final Handler next;
 
     protected AbstractImmutableHandler(Handler next) {
@@ -72,6 +76,14 @@
         }
     }
 
+    public void removeHandler(Handler handler) {
+        if (next instanceof HandlerContainer) {
+            ((HandlerContainer) next).removeHandler(handler);
+        } else {
+            throw new RuntimeException("geronimo HandlerContainers are immutable");
+        }
+    }
+
     /**
      * this is basically the implementation from HandlerWrapper.
      * @param list partial list of handlers matching byClass (may be null)
@@ -84,12 +96,55 @@
         return null;
     }
 
+    /**
+     * this is basically the implementation from AbstractLifeCycle
+     */
     public void start() throws Exception {
-        next.start();
+        synchronized (_lock)
+        {
+            try
+            {
+                if (isStarted() || isStarting())
+                    return;
+                setStarting();
+                doStart();
+                setStarted();
+            }
+            catch (Exception e)
+            {
+                setFailed(e);
+                throw e;
+            }
+            catch (Error e)
+            {
+                setFailed(e);
+                throw e;
+            }
+        }
     }
 
     public void stop() throws Exception {
-        next.stop();
+        synchronized (_lock)
+        {
+            try
+            {
+                if (isStopping() || isStopped())
+                    return;
+                setStopping();
+                doStop();
+                setStopped();
+            }
+            catch (Exception e)
+            {
+                setFailed(e);
+                throw e;
+            }
+            catch (Error e)
+            {
+                setFailed(e);
+                throw e;
+            }
+        }
     }
 
     public boolean isRunning() {
@@ -113,6 +168,70 @@
     }
 
     public boolean isFailed() {
-        return false;
+        return next.isFailed();
     }
+
+    public void addLifeCycleListener(LifeCycle.Listener listener) {
+        _listeners = (LifeCycle.Listener[])LazyList.addToArray(_listeners,listener,LifeCycle.Listener.class);
+    }
+
+    public void removeLifeCycleListener(LifeCycle.Listener listener) {
+        LazyList.removeFromArray(_listeners,listener);
+    }
+
+    private void setStarted()
+    {
+        if (_listeners != null)
+        {
+            for (int i = 0; i < _listeners.length; i++)
+            {
+                _listeners[i].lifeCycleStarted(this);
+            }
+        }
+    }
+
+    private void setStarting()
+    {
+        if (_listeners != null)
+        {
+            for (int i = 0; i < _listeners.length; i++)
+            {
+                _listeners[i].lifeCycleStarting(this);
+            }
+        }
+    }
+
+    private void setStopping()
+    {
+        if (_listeners != null)
+        {
+            for (int i = 0; i < _listeners.length; i++)
+            {
+                _listeners[i].lifeCycleStopping(this);
+            }
+        }
+    }
+
+    private void setStopped()
+    {
+        if (_listeners != null)
+        {
+            for (int i = 0; i < _listeners.length; i++)
+            {
+                _listeners[i].lifeCycleStopped(this);
+            }
+        }
+    }
+
+    private void setFailed(Throwable error)
+    {
+        if (_listeners != null)
+        {
+            for (int i = 0; i < _listeners.length; i++)
+            {
+                _listeners[i].lifeCycleFailure(this,error);
+            }
+        }
+    }
+
 }

Modified: geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/TwistyWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/TwistyWebAppContext.java?rev=722538&r1=722537&r2=722538&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/TwistyWebAppContext.java
(original)
+++ geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/TwistyWebAppContext.java
Tue Dec  2 09:40:24 2008
@@ -26,6 +26,7 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.ServletException;
 
+import org.mortbay.component.LifeCycle;
 import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.handler.ErrorHandler;
@@ -33,6 +34,8 @@
 import org.mortbay.jetty.servlet.ServletHandler;
 import org.mortbay.jetty.servlet.SessionHandler;
 import org.mortbay.jetty.webapp.WebAppContext;
+import org.mortbay.util.LazyList;
+
 
 /**
  * @version $Rev$ $Date$
@@ -60,6 +63,8 @@
     }
 
     private class TwistyHandler implements Handler {
+        private Object _lock = new Object();
+        protected LifeCycle.Listener[] _listeners;
 
         public void handle(String target, HttpServletRequest request, HttpServletResponse
response, int dispatch) throws IOException, ServletException {
             TwistyWebAppContext.super.handle(target, request, response, dispatch);
@@ -77,12 +82,55 @@
             TwistyWebAppContext.super.destroy();
         }
 
+        /*
+         * this is basically the implementation from AbstractLifeCycle
+         */
         public void start() throws Exception {
-            TwistyWebAppContext.super.start();
+            synchronized (_lock)
+            {
+                try
+                {
+                    if (isStarted() || isStarting())
+                        return;
+                    setStarting();
+                    TwistyWebAppContext.super.start();
+                    setStarted();
+                }
+                catch (Exception e)
+                {
+                    setFailed(e);
+                    throw e;
+                }
+                catch (Error e)
+                {
+                    setFailed(e);
+                    throw e;
+                }
+            }
         }
 
         public void stop() throws Exception {
-            TwistyWebAppContext.super.stop();
+            synchronized (_lock)
+            {
+                try
+                {
+                    if (isStopping() || isStopped())
+                        return;
+                    setStopping();
+                    TwistyWebAppContext.super.stop();
+                    setStopped();
+                }
+                catch (Exception e)
+                {
+                    setFailed(e);
+                    throw e;
+                }
+                catch (Error e)
+                {
+                    setFailed(e);
+                    throw e;
+                }
+            }
         }
 
         public boolean isRunning() {
@@ -108,5 +156,70 @@
         public boolean isFailed() {
             return TwistyWebAppContext.super.isFailed();
         }
+
+        public void addLifeCycleListener(LifeCycle.Listener listener)
+        {
+            _listeners = (LifeCycle.Listener[])LazyList.addToArray(_listeners,listener,LifeCycle.Listener.class);
+        }
+
+        public void removeLifeCycleListener(LifeCycle.Listener listener)
+        {
+            LazyList.removeFromArray(_listeners,listener);
+        }
+
+        private void setStarted()
+        {
+            if (_listeners != null)
+            {
+                for (int i = 0; i < _listeners.length; i++)
+                {
+                    _listeners[i].lifeCycleStarted(this);
+                }
+            }
+        }
+
+        private void setStarting()
+        {
+            if (_listeners != null)
+            {
+                for (int i = 0; i < _listeners.length; i++)
+                {
+                    _listeners[i].lifeCycleStarting(this);
+                }
+            }
+        }
+
+        private void setStopping()
+        {
+            if (_listeners != null)
+            {
+                for (int i = 0; i < _listeners.length; i++)
+                {
+                    _listeners[i].lifeCycleStopping(this);
+                }
+            }
+        }
+
+        private void setStopped()
+        {
+            if (_listeners != null)
+            {
+                for (int i = 0; i < _listeners.length; i++)
+                {
+                    _listeners[i].lifeCycleStopped(this);
+                }
+            }
+        }
+
+        private void setFailed(Throwable error)
+        {
+            if (_listeners != null)
+            {
+                for (int i = 0; i < _listeners.length; i++)
+                {
+                    _listeners[i].lifeCycleFailure(this,error);
+                }
+            }
+        }
     }
 }

Modified: geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java?rev=722538&r1=722537&r2=722538&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java
(original)
+++ geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/ApplicationTest.java
Tue Dec  2 09:40:24 2008
@@ -27,6 +27,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.mortbay.component.LifeCycle;
 import org.mortbay.jetty.servlet.SessionHandler;
 
 
@@ -69,7 +70,12 @@
                         throws IOException, ServletException {
                     next.handle(target, request, response, dispatch);
                 }
-                
+
+                public void addLifeCycleListener(LifeCycle.Listener listener) {
+                }
+
+                public void removeLifeCycleListener(LifeCycle.Listener listener) {
+                }
             };
         }
 

Modified: geronimo/server/trunk/plugins/jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/pom.xml?rev=722538&r1=722537&r2=722538&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/pom.xml (original)
+++ geronimo/server/trunk/plugins/jetty/pom.xml Tue Dec  2 09:40:24 2008
@@ -42,7 +42,7 @@
             <dependency>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>jetty</artifactId>
-                <version>6.1.7</version>
+                <version>6.1.14</version>
                 <exclusions>
                     <exclusion>
                         <groupId>org.mortbay.jetty</groupId>
@@ -54,19 +54,19 @@
             <dependency>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>jetty-ajp</artifactId>
-                <version>6.1.7</version>
+                <version>6.1.14</version>
             </dependency>
 
             <dependency>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>jetty-sslengine</artifactId>
-                <version>6.1.7</version>
+                <version>6.1.14</version>
             </dependency>
 
             <dependency>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>jetty-util</artifactId>
-                <version>6.1.7</version>
+                <version>6.1.14</version>
             </dependency>
 
         </dependencies>



Mime
View raw message