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

Gavin King gavin.king at jboss.com
Sun Feb 11 14:59:41 EST 2007


  User: gavin   
  Date: 07/02/11 14:59:41

  Modified:    src/main/org/jboss/seam  Component.java
  Log:
  selective conversationinterceptor
  
  Revision  Changes    Path
  1.235     +27 -3     jboss-seam/src/main/org/jboss/seam/Component.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Component.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Component.java,v
  retrieving revision 1.234
  retrieving revision 1.235
  diff -u -b -r1.234 -r1.235
  --- Component.java	11 Feb 2007 19:48:12 -0000	1.234
  +++ Component.java	11 Feb 2007 19:59:41 -0000	1.235
  @@ -56,11 +56,15 @@
   
   import org.hibernate.validator.ClassValidator;
   import org.jboss.seam.annotations.Asynchronous;
  +import org.jboss.seam.annotations.Begin;
  +import org.jboss.seam.annotations.BeginTask;
   import org.jboss.seam.annotations.Conversational;
   import org.jboss.seam.annotations.Create;
   import org.jboss.seam.annotations.DataBinderClass;
   import org.jboss.seam.annotations.DataSelectorClass;
   import org.jboss.seam.annotations.Destroy;
  +import org.jboss.seam.annotations.End;
  +import org.jboss.seam.annotations.EndTask;
   import org.jboss.seam.annotations.IfInvalid;
   import org.jboss.seam.annotations.In;
   import org.jboss.seam.annotations.Interceptors;
  @@ -71,6 +75,7 @@
   import org.jboss.seam.annotations.RequestParameter;
   import org.jboss.seam.annotations.Rollback;
   import org.jboss.seam.annotations.Scope;
  +import org.jboss.seam.annotations.StartTask;
   import org.jboss.seam.annotations.Startup;
   import org.jboss.seam.annotations.Synchronized;
   import org.jboss.seam.annotations.Transactional;
  @@ -123,7 +128,7 @@
    *
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
    * @author Gavin King
  - * @version $Revision: 1.234 $
  + * @version $Revision: 1.235 $
    */
   @Scope(ScopeType.APPLICATION)
   @SuppressWarnings("deprecation")
  @@ -156,6 +161,7 @@
      private Map<String, Method> removeMethods = new HashMap<String, Method>();
      private Set<Method> validateMethods = new HashSet<Method>();
      private Set<Method> lifecycleMethods = new HashSet<Method>();
  +   private Set<Method> conversationManagementMethods;
      
      private List<BijectedAttribute<In>> inAttributes = new ArrayList<BijectedAttribute<In>>();
      private List<BijectedAttribute<Out>> outAttributes = new ArrayList<BijectedAttribute<Out>>();
  @@ -535,6 +541,14 @@
                     throw new IllegalArgumentException("@PersistenceContext may only be used on session bean or message driven bean components: " + name);
                  }
               }
  +            if ( method.isAnnotationPresent(Begin.class) || 
  +                 method.isAnnotationPresent(End.class) || 
  +                 method.isAnnotationPresent(StartTask.class) ||
  +                 method.isAnnotationPresent(BeginTask.class) ||
  +                 method.isAnnotationPresent(EndTask.class) ) 
  +            {
  +               conversationManagementMethods.add(method);
  +            }
               
               for ( Annotation ann: method.getAnnotations() )
               {
  @@ -809,7 +823,10 @@
               addInterceptor( new Interceptor( new BusinessProcessInterceptor(), this ) );
            }
         }
  +      if ( !conversationManagementMethods.isEmpty() )
  +      {
         addInterceptor( new Interceptor( new ConversationInterceptor(), this ) );
  +      }
         if ( needsInjection() || needsOutjection() )
         {
            addInterceptor( new Interceptor( new BijectionInterceptor(), this ) );
  @@ -1945,7 +1962,8 @@
         return interceptionType;
      }
   
  -   public boolean isStartup() {
  +   public boolean isStartup() 
  +   {
         return startup;
      }
   
  @@ -1960,6 +1978,12 @@
               lifecycleMethods.contains(method);
      }
   
  +   public boolean isConversationManagementMethod(Method method)
  +   {
  +      return method!=null && 
  +            conversationManagementMethods.contains(method);
  +   }
  +
      public static interface InitialValue
      {
         Object getValue(Class type);
  
  
  



More information about the jboss-cvs-commits mailing list