Author: remy.maucherat(a)jboss.com
Date: 2011-05-27 12:12:11 -0400 (Fri, 27 May 2011)
New Revision: 1728
Modified:
trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java
trunk/java/org/apache/catalina/core/StandardWrapperValve.java
trunk/webapps/docs/changelog.xml
Log:
- Fix STM impl, which was broken by a bad simplification of the filter chain.
Modified: trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationDispatcher.java 2011-05-25 15:41:20 UTC
(rev 1727)
+++ trunk/java/org/apache/catalina/core/ApplicationDispatcher.java 2011-05-27 16:12:11 UTC
(rev 1728)
@@ -718,7 +718,7 @@
// Get the FilterChain Here
ApplicationFilterFactory factory = ApplicationFilterFactory.getInstance();
- ApplicationFilterChain filterChain = factory.createFilterChain(request,
wrapper);
+ ApplicationFilterChain filterChain = factory.createFilterChain(request, wrapper,
servlet);
// Call the service() method for the allocated servlet instance
String jspFile = wrapper.getJspFile();
try {
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterChain.java 2011-05-25 15:41:20
UTC (rev 1727)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterChain.java 2011-05-27 16:12:11
UTC (rev 1728)
@@ -160,6 +160,12 @@
private Wrapper wrapper = null;
+ /**
+ * The servlet to be executed by this chain.
+ */
+ private Servlet servlet = null;
+
+
/**
* The string manager for our package.
*/
@@ -296,7 +302,6 @@
}
// We fell off the end of the chain -- call the servlet instance
- Servlet servlet = wrapper.getServlet();
pointer++;
try {
support.fireInstanceEvent(InstanceEvent.BEFORE_SERVICE_EVENT,
@@ -470,7 +475,6 @@
}
// We fell off the end of the chain -- call the servlet instance
- Servlet servlet = wrapper.getServlet();
pointer++;
try {
support.fireInstanceEvent(InstanceEvent.BEFORE_SERVICE_EVENT,
@@ -544,6 +548,7 @@
filterCount = 0;
pos = 0;
pointer = 0;
+ servlet = null;
wrapper = null;
requestFacade.releaseFilterChain();
@@ -562,7 +567,7 @@
/**
* Set the wrapper that will be executed at the end of this chain.
*
- * @param servlet The Wrapper to be executed
+ * @param wrapper The Wrapper to be executed
*/
void setWrapper(Wrapper wrapper) {
@@ -572,6 +577,18 @@
/**
+ * Set the servlet that will be executed at the end of this chain.
+ *
+ * @param servlet The Servlet to be executed
+ */
+ void setServlet(Servlet servlet) {
+
+ this.servlet = servlet;
+
+ }
+
+
+ /**
* Set the RequestFacade object used for removing the association of the
* chain from the request facade.
*
@@ -600,5 +617,9 @@
return wrapper;
}
+ public Servlet getServlet() {
+ return servlet;
+ }
+
}
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java 2011-05-25 15:41:20
UTC (rev 1727)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java 2011-05-27 16:12:11
UTC (rev 1728)
@@ -47,6 +47,7 @@
package org.apache.catalina.core;
+import javax.servlet.Servlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestWrapper;
@@ -123,7 +124,7 @@
* @param request The servlet request we are processing
* @param wrapper The servlet instance to be wrapped
*/
- public ApplicationFilterChain createFilterChain(ServletRequest request, Wrapper
wrapper) {
+ public ApplicationFilterChain createFilterChain(ServletRequest request, Wrapper
wrapper, Servlet servlet) {
// get the dispatcher type
int dispatcher = -1;
@@ -185,6 +186,7 @@
filterChain.setRequestFacade(requestFacade);
}
filterChain.setWrapper(wrapper);
+ filterChain.setServlet(servlet);
// Acquire the filter mappings for this Context
StandardContext context = (StandardContext) wrapper.getParent();
Modified: trunk/java/org/apache/catalina/core/StandardWrapperValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapperValve.java 2011-05-25 15:41:20 UTC
(rev 1727)
+++ trunk/java/org/apache/catalina/core/StandardWrapperValve.java 2011-05-27 16:12:11 UTC
(rev 1728)
@@ -251,7 +251,7 @@
ApplicationFilterFactory factory =
ApplicationFilterFactory.getInstance();
ApplicationFilterChain filterChain =
- factory.createFilterChain(request, wrapper);
+ factory.createFilterChain(request, wrapper, servlet);
// Reset event flag value after creating the filter chain
request.setEventMode(false);
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-05-25 15:41:20 UTC (rev 1727)
+++ trunk/webapps/docs/changelog.xml 2011-05-27 16:12:11 UTC (rev 1728)
@@ -29,6 +29,9 @@
Low memory default for session manager (with low max amount of sessions), and
disable
session persistence by default. (remm)
</fix>
+ <fix>
+ SingleThreadModel handling was not properly implemented following a filter chain
simplification. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">