[jboss-cvs] jboss-seam/src/ioc/org/jboss/seam/ioc/spring ...

Gavin King gavin.king at jboss.com
Wed Jun 20 13:47:19 EDT 2007


  User: gavin   
  Date: 07/06/20 13:47:19

  Modified:    src/ioc/org/jboss/seam/ioc/spring       ContextLoader.java
                        SeamNamespaceHandler.java SeamTargetSource.java
                        SpringComponent.java SpringELResolver.java
                        spring-seam-1.3.xsd
  Log:
  refactored interception annotations
  
  Revision  Changes    Path
  1.6       +2 -3      jboss-seam/src/ioc/org/jboss/seam/ioc/spring/ContextLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ContextLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/ContextLoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- ContextLoader.java	20 Jun 2007 08:23:16 -0000	1.5
  +++ ContextLoader.java	20 Jun 2007 17:47:19 -0000	1.6
  @@ -1,6 +1,5 @@
   package org.jboss.seam.ioc.spring;
   
  -import static org.jboss.seam.InterceptionType.NEVER;
   import static org.jboss.seam.annotations.Install.BUILT_IN;
   
   import javax.servlet.ServletContext;
  @@ -9,10 +8,10 @@
   import org.jboss.seam.annotations.Create;
   import org.jboss.seam.annotations.Destroy;
   import org.jboss.seam.annotations.Install;
  -import org.jboss.seam.annotations.Intercept;
   import org.jboss.seam.annotations.Name;
   import org.jboss.seam.annotations.Scope;
   import org.jboss.seam.annotations.Startup;
  +import org.jboss.seam.annotations.intercept.BypassInterceptors;
   import org.jboss.seam.contexts.ServletLifecycle;
   import org.springframework.web.context.ConfigurableWebApplicationContext;
   import org.springframework.web.context.WebApplicationContext;
  @@ -24,7 +23,7 @@
    * @author Mike Youngstrom
    */
   @Scope(ScopeType.APPLICATION)
  - at Intercept(NEVER)
  + at BypassInterceptors
   @Startup(depends="org.jboss.seam.ioc.spring.springELResolver")
   @Name("org.jboss.seam.ioc.spring.contextLoader")
   @Install(value = false, precedence = BUILT_IN)
  
  
  
  1.7       +3 -4      jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamNamespaceHandler.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamNamespaceHandler.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamNamespaceHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- SeamNamespaceHandler.java	20 Mar 2007 16:11:36 -0000	1.6
  +++ SeamNamespaceHandler.java	20 Jun 2007 17:47:19 -0000	1.7
  @@ -1,6 +1,5 @@
   package org.jboss.seam.ioc.spring;
   
  -import org.jboss.seam.InterceptionType;
   import org.jboss.seam.ScopeType;
   import org.jboss.seam.core.Init;
   import org.springframework.beans.factory.BeanDefinitionStoreException;
  @@ -102,7 +101,7 @@
       */
      private static class SeamComponentBeanDefinitionDecorator implements BeanDefinitionDecorator
      {
  -      private static final String INTERCEPT_TYPE_ATTR = "intercept-type";
  +      private static final String INTERCEPT_TYPE_ATTR = "intercept";
   
         private static final String SPRING_NAME_ATTR = "spring-name";
   
  @@ -162,10 +161,10 @@
               springName = node.getAttributes().getNamedItem(SPRING_NAME_ATTR).getNodeValue();
            }
            // get the interception type to use
  -         InterceptionType interceptionType = null;
  +         Boolean interceptionType = null;
            if (node.getAttributes().getNamedItem(INTERCEPT_TYPE_ATTR) != null)
            {
  -            interceptionType = InterceptionType.valueOf(node.getAttributes().getNamedItem(
  +            interceptionType = Boolean.valueOf(node.getAttributes().getNamedItem(
                        INTERCEPT_TYPE_ATTR).getNodeValue());
            }
            // get the requested scope
  
  
  
  1.9       +1 -2      jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamTargetSource.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamTargetSource.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamTargetSource.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- SeamTargetSource.java	1 May 2007 16:43:50 -0000	1.8
  +++ SeamTargetSource.java	20 Jun 2007 17:47:19 -0000	1.9
  @@ -7,7 +7,6 @@
   import javax.servlet.http.HttpSessionActivationListener;
   
   import org.jboss.seam.Component;
  -import org.jboss.seam.InterceptionType;
   import org.jboss.seam.ScopeType;
   import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.contexts.Lifecycle;
  @@ -130,7 +129,7 @@
         Component component = getComponent();
         // Attempt to piece together all of the possible interfaces to apply
         // to our proxy.
  -      if (component != null && component.getInterceptionType() != InterceptionType.NEVER)
  +      if ( component != null && component.isInterceptionEnabled() )
         {
            if (component.getType().isSessionBean())
            {
  
  
  
  1.11      +12 -13    jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SpringComponent.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SpringComponent.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SpringComponent.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- SpringComponent.java	18 Jun 2007 21:32:00 -0000	1.10
  +++ SpringComponent.java	20 Jun 2007 17:47:19 -0000	1.11
  @@ -6,7 +6,6 @@
   import java.util.Map;
   
   import org.jboss.seam.Component;
  -import org.jboss.seam.InterceptionType;
   import org.jboss.seam.ScopeType;
   import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.contexts.Lifecycle;
  @@ -32,7 +31,7 @@
   
       private BeanFactory beanfactory;
   
  -    private InterceptionType interceptionType;
  +    private Boolean interceptionEnabled;
   
       private String springBeanName;
   
  @@ -56,10 +55,10 @@
        * @param beanClassName the seam beanClass to use
        * @param scopeType the scope of this component
        * @param beanFactory the beanfactory this spring bean exists in
  -     * @param interceptorType the InterceptorTyp to force the bean to use. Will override any annotations on the bean.
  +     * @param intercept the InterceptorTyp to force the bean to use. Will override any annotations on the bean.
        */
       public static void addSpringComponent(String componentName, String springBeanName, String beanClassName,
  -            ScopeType scopeType, BeanFactory beanFactory, InterceptionType interceptorType)
  +            ScopeType scopeType, BeanFactory beanFactory, Boolean intercept)
       {
           // mock the application context
           // TODO reuse
  @@ -84,7 +83,7 @@
               Contexts.getApplicationContext().set(
                       componentName + Initialization.COMPONENT_SUFFIX,
                       new SpringComponent(beanClass, componentName, springBeanName, scopeType, beanFactory,
  -                            interceptorType));
  +                            intercept));
           }
           catch (ClassNotFoundException e)
           {
  @@ -146,15 +145,15 @@
        * @param springBeanName the spring bean name
        * @param scope component scope
        * @param factory the beanfactory this spring component should use
  -     * @param interception the interception type
  +     * @param intercept the interception type
        */
       public SpringComponent(Class clazz, String componentName, String springBeanName, ScopeType scope,
  -            BeanFactory factory, InterceptionType interception)
  +            BeanFactory factory, Boolean intercept)
       {
           super(clazz, componentName, scope);
           this.springBeanName = springBeanName;
           this.beanfactory = factory;
  -        this.interceptionType = interception;
  +        this.interceptionEnabled = intercept;
       }
   
       @Override
  @@ -239,16 +238,16 @@
       /**
        * Use the InterceptionType override if available otherwise use the annotation or seam default.
        *
  -     * @see org.jboss.seam.Component#getInterceptionType()
  +     * @see org.jboss.seam.Component#isInterceptionEnabled()
        */
       @Override
  -    public InterceptionType getInterceptionType()
  +    public boolean isInterceptionEnabled()
       {
  -        if (interceptionType == null)
  +        if (interceptionEnabled == null)
           {
  -            return super.getInterceptionType();
  +            return super.isInterceptionEnabled();
           }
  -        return interceptionType;
  +        return interceptionEnabled;
       }
       
       @Override
  
  
  
  1.5       +2 -4      jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SpringELResolver.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SpringELResolver.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SpringELResolver.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- SpringELResolver.java	20 Jun 2007 08:23:16 -0000	1.4
  +++ SpringELResolver.java	20 Jun 2007 17:47:19 -0000	1.5
  @@ -1,7 +1,5 @@
   package org.jboss.seam.ioc.spring;
   
  -import static org.jboss.seam.InterceptionType.NEVER;
  -
   import java.beans.FeatureDescriptor;
   import java.util.Iterator;
   
  @@ -13,10 +11,10 @@
   import org.jboss.seam.ScopeType;
   import org.jboss.seam.annotations.Create;
   import org.jboss.seam.annotations.Install;
  -import org.jboss.seam.annotations.Intercept;
   import org.jboss.seam.annotations.Name;
   import org.jboss.seam.annotations.Scope;
   import org.jboss.seam.annotations.Startup;
  +import org.jboss.seam.annotations.intercept.BypassInterceptors;
   import org.jboss.seam.contexts.ServletLifecycle;
   import org.jboss.seam.el.EL;
   import org.jboss.seam.log.LogProvider;
  @@ -34,7 +32,7 @@
   @Name("org.jboss.seam.ioc.spring.springELResolver")
   @Install(precedence = Install.FRAMEWORK, classDependencies="org.springframework.beans.factory.BeanFactory")
   @Startup
  - at Intercept(NEVER)
  + at BypassInterceptors
   public class SpringELResolver extends ELResolver
   {
      private static final LogProvider log = Logging.getLogProvider(SpringELResolver.class);
  
  
  
  1.2       +4 -13     jboss-seam/src/ioc/org/jboss/seam/ioc/spring/spring-seam-1.3.xsd
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: spring-seam-1.3.xsd
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/spring-seam-1.3.xsd,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- spring-seam-1.3.xsd	22 May 2007 02:17:58 -0000	1.1
  +++ spring-seam-1.3.xsd	20 Jun 2007 17:47:19 -0000	1.2
  @@ -156,25 +156,16 @@
                       </xsd:documentation>
                   </xsd:annotation>
               </xsd:attribute>
  -            <xsd:attribute name="intercept-type" use="optional">
  +            <xsd:attribute name="intercept" type="xsd:boolean" use="optional">
                   <xsd:annotation>
                       <xsd:documentation>
                           <![CDATA[
  -                                 Overrides the default InterceptionType seam uses when determining if it's interceptors should be wrapped around a bean.
  -                                 Seldom do you want the seam interceptors wrapped around a sprig singleton.  Auto will use choose NEVER for a singleton
  -                                 and use seam standard rules otherwise.
  +                                 Determines whether Seam interceptors should be wrapped around a bean, by overriding Seam's default rules. 
  +                                 Seldom do you want the seam interceptors wrapped around a sprig singleton.  Auto will use choose no
  +                                 interception for a singleton and use Seam standard rules otherwise.
                           ]]>
                       </xsd:documentation>
                   </xsd:annotation>
  -                <xsd:simpleType>
  -                    <xsd:restriction base="xsd:string">
  -                        <xsd:enumeration value="NEVER" />
  -                        <xsd:enumeration value="AFTER_RESTORE_VIEW" />
  -                        <xsd:enumeration value="AFTER_UPDATE_MODEL_VALUES" />
  -                        <xsd:enumeration value="INVOKE_APPLICATION" />
  -                        <xsd:enumeration value="ALWAYS" />
  -                    </xsd:restriction>
  -                </xsd:simpleType>
               </xsd:attribute>
               <xsd:attribute name="auto-create" type="xsd:boolean" use="optional" default="true">
                   <xsd:annotation>
  
  
  



More information about the jboss-cvs-commits mailing list