Author: remy.maucherat(a)jboss.com
Date: 2011-07-04 09:55:32 -0400 (Mon, 04 Jul 2011)
New Revision: 1764
Modified:
trunk/java/org/apache/catalina/core/StandardHostValve.java
trunk/java/org/apache/catalina/core/StandardWrapperValve.java
Log:
- I no longer feel additional regular resumes are that anormal, so filter them out for now
(the main issue with them was the resume loop it created with the complete() call).
Modified: trunk/java/org/apache/catalina/core/StandardHostValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardHostValve.java 2011-07-04 13:29:00 UTC
(rev 1763)
+++ trunk/java/org/apache/catalina/core/StandardHostValve.java 2011-07-04 13:55:32 UTC
(rev 1764)
@@ -213,6 +213,15 @@
// Select the Context to be used for this Request
Context context = request.getContext();
+ // Some regular callback events should be filtered out for Servlet 3 async
+ if (request.getAsyncContext() != null) {
+ Request.AsyncContextImpl asyncContext = (Request.AsyncContextImpl)
request.getAsyncContext();
+ if (event.getType() == EventType.EVENT && asyncContext.getRunnable()
== null
+ && asyncContext.getPath() == null) {
+ return;
+ }
+ }
+
// Bind the context CL to the current thread
if (context.getLoader() != null) {
Thread.currentThread().setContextClassLoader(context.getLoader().getClassLoader());
@@ -237,6 +246,7 @@
instances[i].getClass().getName()), t);
ServletRequest sreq = request.getRequest();
sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
+
Thread.currentThread().setContextClassLoader(StandardHostValve.class.getClassLoader());
return;
}
}
Modified: trunk/java/org/apache/catalina/core/StandardWrapperValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapperValve.java 2011-07-04 13:29:00 UTC
(rev 1763)
+++ trunk/java/org/apache/catalina/core/StandardWrapperValve.java 2011-07-04 13:55:32 UTC
(rev 1764)
@@ -639,9 +639,6 @@
if (!asyncContext.isReady()) {
asyncContext.complete();
}
- } else {
-
container.getLogger().warn(sm.getString("standardWrapper.async.invalidContext",
- getContainer().getName()));
}
}
@@ -665,7 +662,6 @@
Throwable exception) {
request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, exception);
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-
}
public long getProcessingTime() {
Show replies by date