tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject tomee git commit: async listener clarification of servlet spec, fixing OpenEJBValve usage
Date Mon, 12 Mar 2018 22:41:45 GMT
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x 1f8adb75f -> f4b052cc6


async listener clarification of servlet spec, fixing OpenEJBValve usage


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f4b052cc
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f4b052cc
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f4b052cc

Branch: refs/heads/tomee-1.7.x
Commit: f4b052cc6b171f9c89c85d1f819ea65abced72c2
Parents: 1f8adb7
Author: Romain manni-Bucau <rmannibucau@gmail.com>
Authored: Tue May 17 13:19:24 2016 +0200
Committer: Jonathan Gallimore <jon@jrg.me.uk>
Committed: Mon Mar 12 16:53:23 2018 +0000

----------------------------------------------------------------------
 .../org/apache/tomee/catalina/OpenEJBSecurityListener.java     | 1 +
 .../src/main/java/org/apache/tomee/catalina/OpenEJBValve.java  | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/f4b052cc/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBSecurityListener.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBSecurityListener.java
b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBSecurityListener.java
index 6e2be0f..5c5a15f 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBSecurityListener.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBSecurityListener.java
@@ -45,6 +45,7 @@ public class OpenEJBSecurityListener implements AsyncListener {
 
     @Override
     public void onStartAsync(final AsyncEvent asyncEvent) throws IOException {
+        asyncEvent.getAsyncContext().addListener(this); // super vicious isnt it? that's
in servlet spec, start != end events.
         enter();
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/f4b052cc/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBValve.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBValve.java
b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBValve.java
index 8916aa0..e0d12f3 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBValve.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/OpenEJBValve.java
@@ -38,7 +38,7 @@ public class OpenEJBValve extends ValveBase {
     public void invoke(final Request request, final Response response) throws IOException,
ServletException {
         final OpenEJBSecurityListener listener = new OpenEJBSecurityListener(securityService,
request);
 
-        if (!request.isAsync()) {
+        if (!request.isAsync() || request.getAsyncContextInternal() == null) {
             listener.enter();
             try {
                 getNext().invoke(request, response);
@@ -46,7 +46,9 @@ public class OpenEJBValve extends ValveBase {
                 listener.exit();
             }
         } else {
-            request.getAsyncContext().addListener(new OpenEJBSecurityListener(securityService,
request));
+            request.getAsyncContextInternal().addListener(new OpenEJBSecurityListener(securityService,
request));
+
+            // finally continue the invocation
             getNext().invoke(request, response);
         }
     }


Mime
View raw message