myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
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 GMT
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();
+				}
 			}
 		}
 	}



Mime
View raw message