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

Gavin King gavin.king at jboss.com
Wed Jun 20 13:45:54 EDT 2007


  User: gavin   
  Date: 07/06/20 13:45:54

  Modified:    src/main/org/jboss/seam     Component.java ScopeType.java
                        Seam.java
  Removed:     src/main/org/jboss/seam     InterceptorType.java
  Log:
  refactored interception annotations
  
  Revision  Changes    Path
  1.260     +10 -9     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.259
  retrieving revision 1.260
  diff -u -b -r1.259 -r1.260
  --- Component.java	20 Jun 2007 01:06:33 -0000	1.259
  +++ Component.java	20 Jun 2007 17:45:54 -0000	1.260
  @@ -66,7 +66,6 @@
   import org.jboss.seam.annotations.EndTask;
   import org.jboss.seam.annotations.IfInvalid;
   import org.jboss.seam.annotations.In;
  -import org.jboss.seam.annotations.Interceptors;
   import org.jboss.seam.annotations.JndiName;
   import org.jboss.seam.annotations.Observer;
   import org.jboss.seam.annotations.Out;
  @@ -79,6 +78,8 @@
   import org.jboss.seam.annotations.Transactional;
   import org.jboss.seam.annotations.Unwrap;
   import org.jboss.seam.annotations.datamodel.DataModel;
  +import org.jboss.seam.annotations.intercept.InterceptorType;
  +import org.jboss.seam.annotations.intercept.Interceptors;
   import org.jboss.seam.annotations.jsf.Converter;
   import org.jboss.seam.annotations.jsf.Validator;
   import org.jboss.seam.annotations.security.Restrict;
  @@ -143,7 +144,7 @@
      private String name;
      private ScopeType scope;
      private String jndiName;
  -   private InterceptionType interceptionType;
  +   private boolean interceptionEnabled;
      private boolean startup;
      private String[] dependencies;
      private boolean synchronize;
  @@ -217,7 +218,7 @@
         name = componentName;
         scope = componentScope;
         type = Seam.getComponentType( getBeanClass() );
  -      interceptionType = Seam.getInterceptionType (getBeanClass() );
  +      interceptionEnabled = Seam.isInterceptionEnabled( getBeanClass() );
         
         if ( getBeanClass().isInterface() )
         {
  @@ -252,7 +253,7 @@
   
         businessInterfaces = getBusinessInterfaces( getBeanClass() );
   
  -      if ( interceptionType!=InterceptionType.NEVER)
  +      if ( interceptionEnabled )
         {
            initInterceptors();
         }
  @@ -863,9 +864,9 @@
         for (SortItem<Interceptor> si : siList)
         {
            Class<?> clazz = si.getObj().getUserInterceptorClass();
  -         if ( clazz.isAnnotationPresent(org.jboss.seam.annotations.Interceptor.class) )
  +         if ( clazz.isAnnotationPresent(org.jboss.seam.annotations.intercept.Interceptor.class) )
            {
  -            org.jboss.seam.annotations.Interceptor interceptorAnn = clazz.getAnnotation(org.jboss.seam.annotations.Interceptor.class);
  +            org.jboss.seam.annotations.intercept.Interceptor interceptorAnn = clazz.getAnnotation(org.jboss.seam.annotations.intercept.Interceptor.class);
               for (Class<?> cl : Arrays.asList( interceptorAnn.around() ) )
               {
                  SortItem<Interceptor> sortItem = ht.get(cl);
  @@ -1216,7 +1217,7 @@
      protected Object instantiateJavaBean() throws Exception
      {
         Object bean = getBeanClass().newInstance();
  -      if (interceptionType==InterceptionType.NEVER)
  +      if ( !interceptionEnabled )
         {
            initialize(bean);
            callPostConstructMethod(bean);
  @@ -2131,9 +2132,9 @@
         }
      };
         
  -   public InterceptionType getInterceptionType()
  +   public boolean isInterceptionEnabled()
      {
  -      return interceptionType;
  +      return interceptionEnabled;
      }
   
      public boolean isStartup() 
  
  
  
  1.12      +0 -1      jboss-seam/src/main/org/jboss/seam/ScopeType.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ScopeType.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/ScopeType.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- ScopeType.java	14 Dec 2006 10:26:59 -0000	1.11
  +++ ScopeType.java	20 Jun 2007 17:45:54 -0000	1.12
  @@ -13,7 +13,6 @@
    * The available scopes (contexts).
    * 
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.11 $
    */
   public enum ScopeType 
   {
  
  
  
  1.33      +8 -8      jboss-seam/src/main/org/jboss/seam/Seam.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Seam.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Seam.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -b -r1.32 -r1.33
  --- Seam.java	19 Jun 2007 21:36:38 -0000	1.32
  +++ Seam.java	20 Jun 2007 17:45:54 -0000	1.33
  @@ -1,4 +1,4 @@
  -//$Id: Seam.java,v 1.32 2007/06/19 21:36:38 nrichards Exp $
  +//$Id: Seam.java,v 1.33 2007/06/20 17:45:54 gavin Exp $
   package org.jboss.seam;
   
   import static org.jboss.seam.ComponentType.ENTITY_BEAN;
  @@ -16,10 +16,10 @@
   
   import javax.persistence.Entity;
   
  -import org.jboss.seam.annotations.Intercept;
   import org.jboss.seam.annotations.Name;
   import org.jboss.seam.annotations.Role;
   import org.jboss.seam.annotations.Scope;
  +import org.jboss.seam.annotations.intercept.BypassInterceptors;
   import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.contexts.Lifecycle;
   import org.jboss.seam.core.ServletSession;
  @@ -198,24 +198,24 @@
         return Strings.unqualify( Strings.unqualify( clazz.getName() ), '$' );
      }
      
  -   public static InterceptionType getInterceptionType(Class<?> clazz)
  +   public static boolean isInterceptionEnabled(Class<?> clazz)
      {
         ComponentType componentType = getComponentType(clazz);
         if ( componentType==ENTITY_BEAN )
         {
  -         return InterceptionType.NEVER;
  +         return false;
         }
         else if ( getComponentType(clazz)==MESSAGE_DRIVEN_BEAN )
         {
  -         return InterceptionType.ALWAYS;
  +         return true;
         }
  -      else if ( clazz.isAnnotationPresent(Intercept.class) )
  +      else if ( clazz.isAnnotationPresent(BypassInterceptors.class) )
         {
  -         return clazz.getAnnotation(Intercept.class).value();
  +         return false;
         }
         else 
         {
  -         return InterceptionType.ALWAYS;
  +         return true;
         }
      }
      /**
  
  
  



More information about the jboss-cvs-commits mailing list