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

Gavin King gavin.king at jboss.com
Tue Dec 19 11:57:05 EST 2006


  User: gavin   
  Date: 06/12/19 11:57:05

  Modified:    src/main/org/jboss/seam/core   Manager.java
                        ConversationEntries.java
  Log:
  fix bug with @Begin(id=...)
  
  Revision  Changes    Path
  1.131     +15 -3     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.130
  retrieving revision 1.131
  diff -u -b -r1.130 -r1.131
  --- Manager.java	18 Dec 2006 15:38:49 -0000	1.130
  +++ Manager.java	19 Dec 2006 16:57:04 -0000	1.131
  @@ -42,7 +42,7 @@
    *
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.130 $
  + * @version $Revision: 1.131 $
    */
   @Scope(ScopeType.EVENT)
   @Name("org.jboss.seam.core.manager")
  @@ -87,8 +87,20 @@
         currentConversationEntry = null;
      }
      
  +   /**
  +    * Must not be called from a long-running conversation!
  +    * 
  +    * @param id the new conversation id
  +    */
      public void updateCurrentConversationId(String id)
      {
  +      if ( ConversationEntries.instance().getConversationIds().contains(id) )
  +      {
  +         throw new IllegalStateException("Cannot update conversation id of long-running conversation");
  +      }
  +      
  +      //this stuff is not really necessary, because probably 
  +      //nothing has been flushed to the session yet!
         String[] names = Contexts.getConversationContext().getNames();
         Object[] values = new Object[names.length];
         for (int i=0; i<names.length; i++)
  @@ -98,11 +110,11 @@
         }
         Contexts.getConversationContext().flush();
         
  -      ConversationEntries.instance().updateConversationId( getCurrentConversationId(), id );
         currentConversationIdStack.set(0, id);
         setCurrentConversationId(id);
  -      //TODO: update nested conversations!!!!!
         
  +      //this stuff is not really necessary, because probably 
  +      //nothing has been flushed to the session yet!
         for (int i=0; i<names.length; i++)
         {
            Contexts.getConversationContext().set(names[i], values[i]);
  
  
  
  1.5       +0 -13     jboss-seam/src/main/org/jboss/seam/core/ConversationEntries.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConversationEntries.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/ConversationEntries.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- ConversationEntries.java	24 Nov 2006 23:15:17 -0000	1.4
  +++ ConversationEntries.java	19 Dec 2006 16:57:05 -0000	1.5
  @@ -68,19 +68,6 @@
         return entry;
      }
      
  -   public synchronized ConversationEntry updateConversationId(String oldId, String newId)
  -   {
  -      ConversationEntry entry = conversationIdEntryMap.remove(oldId);
  -      if (entry==null)
  -      {
  -         throw new IllegalStateException("conversation not found");
  -      }
  -      entry.setId(newId);
  -      conversationIdEntryMap.put(newId, entry);
  -      setDirty();
  -      return entry;
  -   }
  -   
      public static ConversationEntries instance()
      {
         if ( !Contexts.isSessionContextActive() )
  
  
  



More information about the jboss-cvs-commits mailing list