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

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


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

  Added:       src/main/org/jboss/seam/annotations/intercept    
                        BypassInterceptors.java Interceptor.java
                        InterceptorType.java Interceptors.java
  Log:
  refactored interception annotations
  
  Revision  Changes    Path
  1.1      date: 2007/06/20 17:45:54;  author: gavin;  state: Exp;jboss-seam/src/main/org/jboss/seam/annotations/intercept/BypassInterceptors.java
  
  Index: BypassInterceptors.java
  ===================================================================
  //$Id: BypassInterceptors.java,v 1.1 2007/06/20 17:45:54 gavin Exp $
  package org.jboss.seam.annotations.intercept;
  
  import static java.lang.annotation.ElementType.METHOD;
  import static java.lang.annotation.ElementType.TYPE;
  import static java.lang.annotation.RetentionPolicy.RUNTIME;
  
  import java.lang.annotation.Documented;
  import java.lang.annotation.Retention;
  import java.lang.annotation.Target;
  
  /**
   * Specifies the interception type of a Seam component.
   * 
   * @author Gavin King
   */
  @Target({TYPE, METHOD})
  @Retention(RUNTIME)
  @Documented
  public @interface BypassInterceptors {}
  
  
  
  1.1      date: 2007/06/20 17:45:54;  author: gavin;  state: Exp;jboss-seam/src/main/org/jboss/seam/annotations/intercept/Interceptor.java
  
  Index: Interceptor.java
  ===================================================================
  package org.jboss.seam.annotations.intercept;
  
  import static java.lang.annotation.ElementType.TYPE;
  import static java.lang.annotation.RetentionPolicy.RUNTIME;
  
  import java.lang.annotation.Documented;
  import java.lang.annotation.Retention;
  import java.lang.annotation.Target;
  
  
  /**
   * Annotates an interceptor class and specifies what 
   * kind of interceptor it is (client side or server 
   * side), and its ordering with respect to other
   * interceptors in the stack.
   * 
   * @author Gavin King
   */
  @Target(TYPE)
  @Retention(RUNTIME)
  @Documented
  public @interface Interceptor
  {
     /**
      * Specifies that the interceptor is a SERVER or CLIENT
      * side interceptor.
      * 
      * @return SERVER by default
      */
     InterceptorType type() default InterceptorType.SERVER;
     /**
      * Specifies that an interceptor is called "around" 
      * another interceptor or interceptors.
      */
     Class[] around() default {};
     /**
      * Specifies that an interceptor is called "within" 
      * another interceptor or interceptors.
      */
     Class[] within() default {};
     /**
      * Performance optimization for stateless interceptors.
      */
     boolean stateless() default false;
  }
  
  
  
  1.1      date: 2007/06/20 17:45:54;  author: gavin;  state: Exp;jboss-seam/src/main/org/jboss/seam/annotations/intercept/InterceptorType.java
  
  Index: InterceptorType.java
  ===================================================================
  package org.jboss.seam.annotations.intercept;
  
  /**
   * The type of an Interceptor, "client-side" (around the EJB proxy object)
   * or "server-side" (inside the EJB interceptor stack).
   * 
   * @author Gavin King
   *
   */
  public enum InterceptorType
  {
     /**
      * An interceptor that wraps the EJB proxy object, and intercepts
      * invocations before EJB itself does any work.
      */
     CLIENT,
     /**
      * An interceptor that runs as part of the EJB interceptor stack.
      */
     SERVER,
     ANY
  }
  
  
  
  1.1      date: 2007/06/20 17:45:54;  author: gavin;  state: Exp;jboss-seam/src/main/org/jboss/seam/annotations/intercept/Interceptors.java
  
  Index: Interceptors.java
  ===================================================================
  //$Id: Interceptors.java,v 1.1 2007/06/20 17:45:54 gavin Exp $
  package org.jboss.seam.annotations.intercept;
  
  import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
  import static java.lang.annotation.RetentionPolicy.RUNTIME;
  
  import java.lang.annotation.Documented;
  import java.lang.annotation.Retention;
  import java.lang.annotation.Target;
  
  /**
   * Synonym for javax.interceptors.Interceptors, for
   * use in a pre Java EE 5 environment. Note that this
   * may only be used as a meta-annotation.
   * 
   * @author Gavin King
   */
  @Target(ANNOTATION_TYPE)
  @Retention(RUNTIME)
  @Documented
  public @interface Interceptors 
  {
     Class[] value();
  }
  
  
  



More information about the jboss-cvs-commits mailing list