openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1648486 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation: ConversationImpl.java ConversationManager.java
Date Tue, 30 Dec 2014 07:25:34 GMT
Author: rmannibucau
Date: Tue Dec 30 07:25:34 2014
New Revision: 1648486

URL: http://svn.apache.org/r1648486
Log:
ensure we dont loose conversation id - avoid to leak in conversation manager mainly

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=1648486&r1=1648485&r2=1648486&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
Tue Dec 30 07:25:34 2014
@@ -56,6 +56,7 @@ public class ConversationImpl implements
     
     /**Conversation id*/
     private String id;
+    private String oldId;
 
     /**Transient or not. Transient conversations are destroyed at the end of JSF request*/
     private boolean isTransient = true;
@@ -234,6 +235,7 @@ public class ConversationImpl implements
         {
             // webBeansContext.getConversationManager().removeConversation(this); // needs
to be done after the request, not here
             iDontUseItAnymore();
+            oldId = id; // keep it to destroy it after Servlet layer even if end() is called
"early"
             id = null;
             isTransient = true;
         }
@@ -244,6 +246,11 @@ public class ConversationImpl implements
         }
     }
 
+    public String getOldId()
+    {
+        return oldId;
+    }
+
     public int iUseIt()
     {
         long thread = Thread.currentThread().getId();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java?rev=1648486&r1=1648485&r2=1648486&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
Tue Dec 30 07:25:34 2014
@@ -89,7 +89,7 @@ public class ConversationManager
         while (it.hasNext())
         {
             conv = (ConversationImpl) it.next();
-            if (conversationId.equals(conv.getId()))
+            if (conversationId.equals(getId(conv)))
             {
                 return true;
             }
@@ -189,7 +189,7 @@ public class ConversationManager
         while (it.hasNext())
         {
             conv = (ConversationImpl) it.next();
-            if (conversationId.equals(conv.getId()) && conv.getSessionId().equals(sessionId))
+            if (conversationId.equals(getId(conv)) && conv.getSessionId().equals(sessionId))
             {
                 return conv;
             }
@@ -198,6 +198,12 @@ public class ConversationManager
         return null;
     }
 
+    private String getId(ConversationImpl conv)
+    {
+        String id = conv.getId();
+        return id == null ? conv.getOldId() : id;
+    }
+
     /**
      * Destroy conversations with given session id.
      * @param sessionId session id



Mime
View raw message