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

Gavin King gavin.king at jboss.com
Sun Oct 15 17:51:59 EDT 2006


  User: gavin   
  Date: 06/10/15 17:51:59

  Modified:    src/main/org/jboss/seam/contexts    Lifecycle.java
                        ServerConversationContext.java
                        WebSessionContext.java
  Log:
  force entity replication
  
  Revision  Changes    Path
  1.61      +9 -1      jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Lifecycle.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -b -r1.60 -r1.61
  --- Lifecycle.java	10 Oct 2006 22:09:05 -0000	1.60
  +++ Lifecycle.java	15 Oct 2006 21:51:59 -0000	1.61
  @@ -9,6 +9,7 @@
   import java.util.Set;
   import javax.faces.context.ExternalContext;
   import javax.faces.event.PhaseId;
  +import javax.persistence.Entity;
   import javax.servlet.ServletContext;
   import javax.servlet.ServletRequest;
   import javax.servlet.http.HttpSession;
  @@ -23,12 +24,13 @@
   import org.jboss.seam.core.Events;
   import org.jboss.seam.core.Init;
   import org.jboss.seam.core.Manager;
  +import org.jboss.seam.core.Mutable;
   import org.jboss.seam.core.ProcessInstance;
   
   /**
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.60 $
  + * @version $Revision: 1.61 $
    */
   public class Lifecycle
   {
  @@ -460,4 +462,10 @@
         exception.set(ex);
      }
   
  +   public static boolean isAttributeDirty(Object attribute)
  +   {
  +      return ( attribute instanceof Mutable && ( (Mutable) attribute ).clearDirty() ) || 
  +            attribute.getClass().isAnnotationPresent(Entity.class);
  +   }
  +
   }
  
  
  
  1.13      +2 -3      jboss-seam/src/main/org/jboss/seam/contexts/ServerConversationContext.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ServerConversationContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/ServerConversationContext.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- ServerConversationContext.java	11 Oct 2006 04:42:12 -0000	1.12
  +++ ServerConversationContext.java	15 Oct 2006 21:51:59 -0000	1.13
  @@ -18,7 +18,6 @@
   import org.jboss.seam.Seam;
   import org.jboss.seam.core.Events;
   import org.jboss.seam.core.Manager;
  -import org.jboss.seam.core.Mutable;
   
   /**
    * A conversation context is a logical context that lasts longer than 
  @@ -26,7 +25,7 @@
    * 
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
    */
   public class ServerConversationContext implements Context {
   
  @@ -177,7 +176,7 @@
         {
            String key = getKey(name);
            Object attribute = session.getAttribute(key);
  -         if ( attribute instanceof Mutable && ( (Mutable) attribute ).clearDirty() )
  +         if ( Lifecycle.isAttributeDirty(attribute) )
            {
               session.setAttribute(key, attribute);
            }
  
  
  
  1.24      +2 -3      jboss-seam/src/main/org/jboss/seam/contexts/WebSessionContext.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: WebSessionContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/WebSessionContext.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -b -r1.23 -r1.24
  --- WebSessionContext.java	11 Oct 2006 04:42:12 -0000	1.23
  +++ WebSessionContext.java	15 Oct 2006 21:51:59 -0000	1.24
  @@ -12,12 +12,11 @@
   import org.jboss.seam.ScopeType;
   import org.jboss.seam.Seam;
   import org.jboss.seam.core.Events;
  -import org.jboss.seam.core.Mutable;
   
   /**
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.23 $
  + * @version $Revision: 1.24 $
    */
   public class WebSessionContext implements Context 
   {
  @@ -93,7 +92,7 @@
         for ( String name: getNames() )
         {
            Object attribute = session.getAttribute(name);
  -         if ( attribute instanceof Mutable && ( (Mutable) attribute ).clearDirty() )
  +         if ( Lifecycle.isAttributeDirty(attribute) )
            {
               session.setAttribute(name, attribute);
            }
  
  
  



More information about the jboss-cvs-commits mailing list