diff --git a/VERSION.txt b/VERSION.txt index b13c775898d..17b00982fec 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,5 +1,6 @@ jetty-7.1.4-SNAPSHOT + 292326 Stop continuations if server is stopped. + + 292814 Make QoSFilter and DoSFilter JMX manageable + 294212 Can not customize session cookie path + 302350 org.eclipse.jetty.server.NCSARequestLog is missing JavaDoc + 304100 Better document JMX setup in jetty-jmx.xml diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java index ba2494f42b3..fcc4d3a7903 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java @@ -53,6 +53,7 @@ import org.eclipse.jetty.util.LazyList; import org.eclipse.jetty.util.MultiException; import org.eclipse.jetty.util.MultiMap; import org.eclipse.jetty.util.URIUtil; +import org.eclipse.jetty.util.component.Container; import org.eclipse.jetty.util.log.Log; /* --------------------------------------------------------------------- */ @@ -661,11 +662,23 @@ public class ServletHandler extends ScopedHandler { MultiException mx = new MultiException(); + Container beanContainer = getServer()==null? null: getServer().getContainer(); + // Start filters if (_filters!=null) { for (int i=0;i<_filters.length; i++) + { _filters[i].start(); + if (beanContainer != null) + { + Filter filter = _filters[i].getFilter(); + if (filter != null && filter.getClass().getName().startsWith("org.eclipse.jetty.")) + { + beanContainer.addBean(filter); + } + } + } } if (_servlets!=null) @@ -689,6 +702,14 @@ public class ServletHandler extends ScopedHandler } servlets[i].start(); + if (beanContainer != null) + { + Servlet servlet = servlets[i].getServletInstance(); + if (servlet != null && servlet.getClass().getName().startsWith("org.eclipse.jetty.")) + { + beanContainer.addBean(servlet); + } + } } catch(Throwable e) { diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java index 02636623da4..24ef842311a 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java @@ -183,10 +183,11 @@ public class DoSFilter implements Filter delay = Integer.parseInt(filterConfig.getInitParameter(DELAY_MS_INIT_PARAM)); _delayMs = delay; - _throttledRequests = __DEFAULT_THROTTLE; + int throttledRequests = __DEFAULT_THROTTLE; if (filterConfig.getInitParameter(THROTTLED_REQUESTS_INIT_PARAM) != null) - _throttledRequests = Integer.parseInt(filterConfig.getInitParameter(THROTTLED_REQUESTS_INIT_PARAM)); - _passes = new Semaphore(_throttledRequests,true); + throttledRequests = Integer.parseInt(filterConfig.getInitParameter(THROTTLED_REQUESTS_INIT_PARAM)); + _passes = new Semaphore(throttledRequests,true); + _throttledRequests = throttledRequests; long wait = __DEFAULT_WAIT_MS; if (filterConfig.getInitParameter(MAX_WAIT_INIT_PARAM) != null) diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java index bac4240f050..16b1de3c074 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/QoSFilter.java @@ -116,10 +116,11 @@ public class QoSFilter implements Filter }; } - int _maxRequests=__DEFAULT_PASSES; + int maxRequests=__DEFAULT_PASSES; if (filterConfig.getInitParameter(MAX_REQUESTS_INIT_PARAM)!=null) - _maxRequests=Integer.parseInt(filterConfig.getInitParameter(MAX_REQUESTS_INIT_PARAM)); - _passes=new Semaphore(_maxRequests,true); + maxRequests=Integer.parseInt(filterConfig.getInitParameter(MAX_REQUESTS_INIT_PARAM)); + _passes=new Semaphore(maxRequests,true); + _maxRequests = maxRequests; long wait = __DEFAULT_WAIT_MS; if (filterConfig.getInitParameter(MAX_WAIT_INIT_PARAM)!=null)