You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2015/05/06 21:40:24 UTC

svn commit: r1678077 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java

Author: struberg
Date: Wed May  6 19:40:24 2015
New Revision: 1678077

URL: http://svn.apache.org/r1678077
Log:
OWB-1050 properly fire @Destroyed(ConversationScoped.class) event

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java?rev=1678077&r1=1678076&r2=1678077&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java Wed May  6 19:40:24 2015
@@ -100,10 +100,11 @@ public abstract class AbstractContextsSe
      */
     public void destroyOutdatedConversations(ConversationContext currentConversationContext)
     {
+        ConversationManager conversationManager = null;
         Context sessionContext = getCurrentContext(SessionScoped.class, false);
         if (sessionContext != null && sessionContext.isActive())
         {
-            ConversationManager conversationManager = webBeansContext.getConversationManager();
+            conversationManager = webBeansContext.getConversationManager();
             Set<ConversationContext> conversationContexts = conversationManager.getSessionConversations(sessionContext, false);
             if (conversationContexts != null)
             {
@@ -127,7 +128,8 @@ public abstract class AbstractContextsSe
             currentConversationContext.getConversation().iDontUseItAnymore();
             if (currentConversationContext.getConversation().isTransient())
             {
-                currentConversationContext.destroy();
+                conversationManager = conversationManager != null ? conversationManager : webBeansContext.getConversationManager();
+                conversationManager.destroyConversationContext(currentConversationContext);
             }
         }
     }