tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject [1/3] tomee git commit: support of conversationPropagation
Date Mon, 29 Dec 2014 13:45:26 GMT
Repository: tomee
Updated Branches:
  refs/heads/develop 2329bf8a4 -> cfbc84335


support of conversationPropagation


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

Branch: refs/heads/develop
Commit: 3b0bc9418d65c7c806db1a9c434eb6ef84269a95
Parents: 2329bf8
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Mon Dec 29 12:51:12 2014 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Mon Dec 29 12:51:12 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/openejb/cdi/CdiAppContextsService.java  | 9 +++++++--
 tck/cdi-embedded/src/test/resources/failing.xml             | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/3b0bc941/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
index 0935ce4..1a6ce55 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
@@ -338,7 +338,7 @@ public class CdiAppContextsService extends AbstractContextsService implements
Co
                     initSessionContext(session);
 
                     final ServletRequestContext rc  = getRequestContext(false);
-                    if (rc != null && rc.getServletRequest() != null && conversationService
!= null) {
+                    if (rc != null && rc.getServletRequest() != null && conversationService
!= null && !isConversationSkipped(rc)) {
                         final String cid = rc.getServletRequest().getParameter("cid");
                         if (cid != null) {
                             final ConversationManager conversationManager = webBeansContext.getConversationManager();
@@ -628,7 +628,7 @@ public class CdiAppContextsService extends AbstractContextsService implements
Co
         ConversationContext context = conversationContext.get();
         if (context == null && createIfPropagated && !isTimeout()) {
             final ServletRequestContext rc  = getRequestContext(true); // needs to exist
for Conversation scope
-            if (rc != null && rc.getServletRequest() != null) {
+            if (rc != null && rc.getServletRequest() != null && !isConversationSkipped(rc))
{
                 final HttpServletRequest servletRequest = rc.getServletRequest();
                 final HttpSession session = servletRequest.getSession(false);
                 if (session != null) {
@@ -653,6 +653,11 @@ public class CdiAppContextsService extends AbstractContextsService implements
Co
         return context;
     }
 
+    private boolean isConversationSkipped(final ServletRequestContext rc) {
+        final HttpServletRequest servletRequest = rc.getServletRequest();
+        return "none".equals(servletRequest.getParameter("conversationPropagation")) || "true".equals(servletRequest.getParameter("nocid"));
+    }
+
     private boolean isTimeout() {
         final ThreadContext tc = ThreadContext.getThreadContext();
         return tc != null && tc.getCurrentOperation() == Operation.TIMEOUT;

http://git-wip-us.apache.org/repos/asf/tomee/blob/3b0bc941/tck/cdi-embedded/src/test/resources/failing.xml
----------------------------------------------------------------------
diff --git a/tck/cdi-embedded/src/test/resources/failing.xml b/tck/cdi-embedded/src/test/resources/failing.xml
index 3176e43..ad0858d 100644
--- a/tck/cdi-embedded/src/test/resources/failing.xml
+++ b/tck/cdi-embedded/src/test/resources/failing.xml
@@ -26,7 +26,7 @@
     -Dopenejb.deploymentId.format={appId}/{ejbJarId}/{ejbName}
     -->
     <classes>
-      <class name="org.jboss.cdi.tck.tests.context.conversation.determination.ConversationDeterminationTest"
/>
+      <class name="org.jboss.cdi.tck.tests.context.conversation.ClientConversationContextTest"
/>
     </classes>
   </test>
 </suite>


Mime
View raw message