[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...

Gavin King gavin.king at jboss.com
Sun Jun 3 16:54:23 EDT 2007


  User: gavin   
  Date: 07/06/03 16:54:23

  Modified:    src/main/org/jboss/seam/core  Manager.java
  Log:
  get rid of conversationIsLongRunning parameter JBSEAM-1005
  
  Revision  Changes    Path
  1.164     +24 -61    jboss-seam/src/main/org/jboss/seam/core/Manager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Manager.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Manager.java,v
  retrieving revision 1.163
  retrieving revision 1.164
  diff -u -b -r1.163 -r1.164
  --- Manager.java	3 Jun 2007 20:01:22 -0000	1.163
  +++ Manager.java	3 Jun 2007 20:54:23 -0000	1.164
  @@ -44,7 +44,7 @@
    *
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.163 $
  + * @version $Revision: 1.164 $
    */
   @Scope(ScopeType.EVENT)
   @Name("org.jboss.seam.core.manager")
  @@ -72,7 +72,6 @@
      
      private String conversationIdParameter = "conversationId";
      private String parentConversationIdParameter = "parentConversationId";
  -   private String conversationIsLongRunningParameter = "conversationIsLongRunning";
   
      // DONT BREAK, icefaces uses this
      public String getCurrentConversationId()
  @@ -429,7 +428,7 @@
      {
         String storedConversationId = null;
         String storedParentConversationId = null;
  -      Boolean isLongRunningConversation = null;
  +      boolean validateLongRunningConversation = false;
         
         //First, try to get the conversation id from the request parameter defined for the page
         String viewId = Pages.getCurrentViewId();
  @@ -449,20 +448,17 @@
         {
            storedParentConversationId = getRequestParameterValue(parameters, parentConversationIdParameter);
         }
  -      isLongRunningConversation = "true".equals( getRequestParameterValue(parameters, conversationIsLongRunningParameter) );
               
  -      if ( isMissing(storedConversationId) )
  -      {
  -         if ( Contexts.isPageContextActive() )
  +      if ( Contexts.isPageContextActive() && isMissing(storedConversationId) ) 
            {
  +         //checkPageContext is a workaround for a bug in MySQL server-side state saving
  +         
               //if it is not passed as a request parameter,
               //try to get it from the page context
               org.jboss.seam.core.FacesPage page = org.jboss.seam.core.FacesPage.instance();
               storedConversationId = page.getConversationId();
               storedParentConversationId = null;
  -            isLongRunningConversation = page.isConversationLongRunning();
  -            //if (isLongRunningConversation==null) isLongRunningConversation = false;
  -         }
  +         validateLongRunningConversation = page.isConversationLongRunning();
         }
   
         else
  @@ -470,25 +466,20 @@
            log.debug("Found conversation id in request parameter: " + storedConversationId);
         }
         
  -      //TODO: this approach is deprecated, remove code:
  -      if ( "new".equals(storedConversationId) )
  -      {
  -         storedConversationId = null;
  -         storedParentConversationId = null;
  -         isLongRunningConversation = false;
  -      }
  -      //end code to remove
  -
         String propagation = getPropagationFromRequestParameter(parameters);
         if ( "none".equals(propagation) )
         {
            storedConversationId = null;
            storedParentConversationId = null;
  -         isLongRunningConversation = false;
  +         validateLongRunningConversation = false;
  +      }
  +      else if ( "end".equals(propagation) )
  +      {
  +         validateLongRunningConversation = false;
         }
         
  -      return restoreConversation(storedConversationId, storedParentConversationId, isLongRunningConversation) 
  -            || "end".equals(propagation);
  +      return restoreConversation(storedConversationId, storedParentConversationId) 
  +               || !validateLongRunningConversation;
         
      }
      
  @@ -552,7 +543,7 @@
       */
      public boolean restoreConversation(String conversationId)
      {
  -      return restoreConversation(conversationId, null, false);
  +      return restoreConversation(conversationId, null);
      }
   
      /**
  @@ -562,7 +553,8 @@
       * the parent, and if that also fails, initialize a new 
       * temporary conversation context.
       */
  -   private boolean restoreConversation(String conversationId, String parentConversationId, boolean isLongRunningConversation) {
  +   private boolean restoreConversation(String conversationId, String parentConversationId) 
  +   {
         ConversationEntry ce = null;
         if (conversationId!=null)
         {
  @@ -574,10 +566,10 @@
            }
         }
         
  -      return restoreAndLockConversation(ce, isLongRunningConversation);
  +      return restoreAndLockConversation(ce);
      }
   
  -   private boolean restoreAndLockConversation(ConversationEntry ce, boolean isLongRunningConversation)
  +   private boolean restoreAndLockConversation(ConversationEntry ce)
      {
         if ( ce!=null && ce.lock() )
         {
  @@ -612,7 +604,7 @@
            //long-running conversation to restore
            log.debug("No stored conversation, or concurrent call to the stored conversation");
            initializeTemporaryConversation();
  -         return !isLongRunningConversation;
  +         return false;
         }
      }
   
  @@ -908,9 +900,6 @@
                     .append(paramName)
                     .append('=')
                     .append( encode( getParentConversationId() ) )
  -                  .append('&')
  -                  .append(conversationIsLongRunningParameter)
  -                  .append("=true")
                     .toString();
            }
            else
  @@ -933,12 +922,6 @@
                     .append('=')
                     .append( encode( getParentConversationId() ) );
            }
  -         if ( isReallyLongRunningConversation() )
  -         {
  -            builder.append('&')
  -                  .append(conversationIsLongRunningParameter)
  -                  .append("=true");
  -         }
            return builder.toString();
         }
      }
  @@ -1178,26 +1161,6 @@
         this.conversationIdParameter = conversationIdParameter;
      }
   
  -   public String getConversationIsLongRunningParameter()
  -   {
  -      return conversationIsLongRunningParameter;
  -   }
  -
  -   public void setConversationIsLongRunningParameter(String conversationIdLongRunning)
  -   {
  -      this.conversationIsLongRunningParameter = conversationIdLongRunning;
  -   }
  -
  -   /*public boolean isUpdateModelValuesCalled()
  -   {
  -      return updateModelValuesCalled;
  -   }
  -
  -   public void setUpdateModelValuesCalled(boolean updateModelValuesCalled)
  -   {
  -      this.updateModelValuesCalled = updateModelValuesCalled;
  -   }*/
  -
      public int getConcurrentRequestTimeout()
      {
         return concurrentRequestTimeout;
  
  
  



More information about the jboss-cvs-commits mailing list