Return-Path: Delivered-To: apmail-myfaces-commits-archive@www.apache.org Received: (qmail 12329 invoked from network); 21 Feb 2008 16:33:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Feb 2008 16:33:33 -0000 Received: (qmail 29727 invoked by uid 500); 21 Feb 2008 16:33:28 -0000 Delivered-To: apmail-myfaces-commits-archive@myfaces.apache.org Received: (qmail 29653 invoked by uid 500); 21 Feb 2008 16:33:28 -0000 Mailing-List: contact commits-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list commits@myfaces.apache.org Received: (qmail 29639 invoked by uid 99); 21 Feb 2008 16:33:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 08:33:28 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 16:33:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AC40A1A9832; Thu, 21 Feb 2008 08:33:12 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r629853 - /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java Date: Thu, 21 Feb 2008 16:33:12 -0000 To: commits@myfaces.apache.org From: skitching@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080221163312.AC40A1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: skitching Date: Thu Feb 21 08:33:11 2008 New Revision: 629853 URL: http://svn.apache.org/viewvc?rev=629853&view=rev Log: Add logging only Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java?rev=629853&r1=629852&r2=629853&view=diff ============================================================================== --- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java (original) +++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/AccessScopePhaseListener.java Thu Feb 21 08:33:11 2008 @@ -26,6 +26,8 @@ import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.myfaces.orchestra.conversation.AccessScopeManager; import org.apache.myfaces.orchestra.conversation.Conversation; import org.apache.myfaces.orchestra.conversation.ConversationAccessLifetimeAspect; @@ -68,6 +70,7 @@ public class AccessScopePhaseListener implements PhaseListener { private static final long serialVersionUID = 1L; + private final Log log = LogFactory.getLog(AccessScopePhaseListener.class); public PhaseId getPhaseId() { @@ -118,6 +121,7 @@ return; } + boolean isDebug = log.isDebugEnabled(); Iterator iterConversations = conversationManager.iterateConversations(); while (iterConversations.hasNext()) { @@ -130,9 +134,27 @@ (ConversationAccessLifetimeAspect) conversation.getAspect(ConversationAccessLifetimeAspect.class); - if (aspect != null && !aspect.isAccessed()) + if (aspect != null) { - conversation.invalidate(); + if (aspect.isAccessed()) + { + if (isDebug) + { + log.debug( + "Not clearing accessed conversation " + conversation.getName() + + " after rendering view " + viewId); + } + } + else + { + if (isDebug) + { + log.debug( + "Clearing access-scoped conversation " + conversation.getName() + + " after rendering view " + viewId); + } + conversation.invalidate(); + } } } }