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

Gavin King gavin.king at jboss.com
Wed Mar 7 20:33:03 EST 2007


  User: gavin   
  Date: 07/03/07 20:33:03

  Modified:    src/main/org/jboss/seam/core   ConversationEntry.java
                        ConversationStack.java
  Log:
  minor
  
  Revision  Changes    Path
  1.34      +27 -5     jboss-seam/src/main/org/jboss/seam/core/ConversationEntry.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConversationEntry.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/ConversationEntry.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -b -r1.33 -r1.34
  --- ConversationEntry.java	21 Dec 2006 02:38:26 -0000	1.33
  +++ ConversationEntry.java	8 Mar 2007 01:33:03 -0000	1.34
  @@ -1,13 +1,12 @@
  -/**
  - *
  - */
   package org.jboss.seam.core;
  +
   import java.io.Serializable;
   import java.util.Collections;
   import java.util.Date;
   import java.util.List;
   import java.util.concurrent.TimeUnit;
   import java.util.concurrent.locks.ReentrantLock;
  +
   /**
    * Metadata about an active conversation. Also used
    * by the conversation list and breadcrumbs.
  @@ -33,11 +32,13 @@
      private ConversationEntries entries;
      
      private ReentrantLock lock;
  +   
      public ConversationEntry(String id, List<String> stack, ConversationEntries entries)
      {
         this.id = id;
  -      this.conversationIdStack = stack==null ? 
  -            null : Collections.unmodifiableList(stack);
  +      if (stack==null || id==null) throw new IllegalArgumentException();
  +      this.conversationIdStack = /*stack==null ? 
  +            Collections.EMPTY_LIST :*/ Collections.unmodifiableList(stack);
         this.startDatetime = new Date();
         this.entries = entries;
         
  @@ -53,38 +54,46 @@
         }
         touch();
      }
  +   
      public String getDescription() 
      {
         return description;
      }
  +   
      void setDescription(String description) 
      {
         entries.setDirty(this.description, description);
         this.description = description;
      }
  +   
      public synchronized long getLastRequestTime() 
      {
         return lastRequestTime;
      }
  +   
      synchronized void touch() 
      {
         entries.setDirty();
         lastRequestTime = System.currentTimeMillis();
         lastDatetime = new Date();
      }
  +   
      public String getId() 
      {
         return id;
      }
  +   
      public Date getStartDatetime() 
      {
         return startDatetime;
      }
  +   
      public void destroy() 
      {
         boolean success = Manager.instance().switchConversation( getId() );
         if (success) Manager.instance().endConversation(false);
      }
  +   
      public void select() 
      {
         switchConversation();
  @@ -111,23 +120,28 @@
            return false;
         }
      }
  +   
      void setViewId(String viewId) 
      {
         entries.setDirty(this.viewId, viewId);
         this.viewId = viewId;
      }
  +   
      public String getViewId()
      {
         return viewId;
      }
  +   
      public synchronized Date getLastDatetime() 
      {
         return lastDatetime;
      }
  +   
      public List<String> getConversationIdStack() 
      {
         return conversationIdStack;
      }
  +   
      /**
       * @deprecated
       * @return a component name
  @@ -136,6 +150,7 @@
      {
         return initiatorComponentName;
      }
  +   
      /**
       * @deprecated
       */
  @@ -143,6 +158,7 @@
         entries.setDirty(this.initiatorComponentName, ownerComponentName);
         this.initiatorComponentName = ownerComponentName;
      }
  +   
      public boolean isDisplayable() 
      {
         return !isEnded() && getDescription()!=null;
  @@ -164,25 +180,30 @@
            return false;
         }
      }
  +   
      public int compareTo(ConversationEntry entry) 
      {
         int result = new Long ( getLastRequestTime() ).compareTo( entry.getLastRequestTime() );
         return - ( result==0 ? getId().compareTo( entry.getId() ) : result );
      }
  +   
      public int getTimeout() 
      {
         return timeout==null ?
               Manager.instance().getConversationTimeout() : timeout;
      }
  +   
      void setTimeout(int conversationTimeout) 
      {
         entries.setDirty(this.timeout, timeout);
         this.timeout = conversationTimeout;
      }
  +   
      public boolean isRemoveAfterRedirect() 
      {
         return removeAfterRedirect;
      }
  +   
      public void setRemoveAfterRedirect(boolean removeAfterRedirect) 
      {
         entries.setDirty();
  @@ -198,6 +219,7 @@
      {
         return lock.tryLock();
      }
  +   
      public boolean lock() //not synchronized!
      {
         try
  
  
  
  1.9       +5 -2      jboss-seam/src/main/org/jboss/seam/core/ConversationStack.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConversationStack.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/ConversationStack.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- ConversationStack.java	21 Dec 2006 02:38:26 -0000	1.8
  +++ ConversationStack.java	8 Mar 2007 01:33:03 -0000	1.9
  @@ -1,4 +1,5 @@
   package org.jboss.seam.core;
  +
   import static org.jboss.seam.InterceptionType.NEVER;
   import static org.jboss.seam.annotations.Install.BUILT_IN;
   import java.io.Serializable;
  @@ -13,17 +14,19 @@
   import org.jboss.seam.annotations.Name;
   import org.jboss.seam.annotations.Scope;
   import org.jboss.seam.annotations.Unwrap;
  +
   /**
    * Support for "breadcrumbs".
    * 
    * @author Gavin King
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   @Scope(ScopeType.PAGE)
   @Name("org.jboss.seam.core.conversationStack")
   @Install(precedence=BUILT_IN)
   @Intercept(NEVER)
  -public class ConversationStack implements Serializable {
  +public class ConversationStack implements Serializable 
  +{
      private static final long serialVersionUID = 7941458529299691801L;
      private List<ConversationEntry> conversationEntryStack;
      
  
  
  



More information about the jboss-cvs-commits mailing list