You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2007/10/04 15:17:54 UTC

svn commit: r581892 - /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/FlashScopePhaseListener.java

Author: skitching
Date: Thu Oct  4 06:17:54 2007
New Revision: 581892

URL: http://svn.apache.org/viewvc?rev=581892&view=rev
Log:
Simplify code a little now that ConversationContext.iterateConversations cannot return null.
Add javadoc and comments.

Modified:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/FlashScopePhaseListener.java

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/FlashScopePhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/FlashScopePhaseListener.java?rev=581892&r1=581891&r2=581892&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/FlashScopePhaseListener.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/jsf/FlashScopePhaseListener.java Thu Oct  4 06:17:54 2007
@@ -53,9 +53,8 @@
 	}
 
 	/**
-	 * invalidates any conversation with aspect {@link ConversationFlashLifetimeAspect}
-	 * not accessed during a http request
-	 * @param viewId
+	 * Invalidates any conversation with aspect {@link ConversationFlashLifetimeAspect}
+	 * which has not been accessed during a http request
 	 */
 	protected void invalidateFlashConversations(String viewId)
 	{
@@ -70,6 +69,12 @@
 			Set ignoredViewIds = flashManager.getFlashScopeManagerConfiguration().getIgnoreViewIds();
 			if (ignoredViewIds != null && ignoredViewIds.contains(viewId))
 			{
+				// The flash configuration has explicitly stated that no conversations should be
+				// terminated when processing this specific view, so just return.
+				// 
+				// Special "ignored views" are useful when dealing with things like nested
+				// frames within a page that periodically refresh themselves while the "main"
+				// part of the page remains unsubmitted.
 				return;
 			}
 		}
@@ -81,14 +86,13 @@
 		}
 
 		Iterator iterConversations = conversationManager.iterateConversations();
-		if (iterConversations == null || !iterConversations.hasNext())
-		{
-			return;
-		}
-
 		while (iterConversations.hasNext())
 		{
 			Conversation conversation = (Conversation) iterConversations.next();
+			
+			// This conversation has "flash" scope if it has an attached Aspect
+			// of type ConversationFlashLifetimeAspect. All other conversations
+			// are not flash-scoped and should be ignored here.
 			ConversationFlashLifetimeAspect aspect =
 				(ConversationFlashLifetimeAspect)
 					conversation.getAspect(ConversationFlashLifetimeAspect.class);