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

Norman Richards norman.richards at jboss.com
Sat Mar 24 23:44:22 EDT 2007


  User: nrichards
  Date: 07/03/24 23:44:22

  Modified:    src/main/org/jboss/seam/contexts 
                        ServerConversationContext.java
  Log:
  JBSEAM-1029: check component class for PerNestedConversation annoation
  
  Revision  Changes    Path
  1.21      +19 -7     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.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- ServerConversationContext.java	21 Feb 2007 16:58:41 -0000	1.20
  +++ ServerConversationContext.java	25 Mar 2007 03:44:22 -0000	1.21
  @@ -27,7 +27,7 @@
    * 
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.20 $
  + * @version $Revision: 1.21 $
    */
   public class ServerConversationContext implements Context {
   
  @@ -108,15 +108,27 @@
                  {
                     String id = stack.get(i);
                     result = session.getAttribute( getKey(name, id) );
  -                  boolean found = result!=null && 
  -                        ( i==0 || !result.getClass().isAnnotationPresent(PerNestedConversation.class) );
  -                  if (found) return unwrapEntityBean(result);
  +
  +                  if (result != null) {
  +                      return unwrapEntityBean(result);
  +
                  }
  +
  +                  // only continue checking if it is not pernestedconversation
  +                  if (i==0 && isPerNestedConversation(name)) {
                  return null;
               }
            }
  +               return null;
         }
   	}
  +      }
  +    }
  +
  +    private boolean isPerNestedConversation(String name) {
  +        Component component = Component.forName(name);
  +        return (component != null) && component.beanClassHasAnnotation(PerNestedConversation.class);
  +    }
   
      private Object unwrapEntityBean(Object result)
      {
  
  
  



More information about the jboss-cvs-commits mailing list