1 Reply Latest reply on Mar 1, 2006 5:48 PM by Gavin King

    Seam Interceptor Questions

    Dennis Wenger Newbie

      I've some questions on Seam Interceptors to understand this better:

      1. is it right, that the seam interceptors (cusom one i mean, the chap in the ref is named like that) are usual intercetors and the only seam controlled thing in th creation of th annotation?

      2. on which parts can these interceptors be placed? all types of EJBs/seam components? Also Entities?
      and on methods, fields, types,...?

      Is there a deeper description than in the reference manual?

      I tried to annotate fields/getters on an entityBean with:

      @Interceptors(TestEntityInterceptor.class)

      I also tried
      @TestEntity

      but nothing worked.
      Any Help wanted :)

      Dennis


      @Target({FIELD, METHOD})
      @Retention(RUNTIME)
      @Documented
      @Interceptors(TestEntityInterceptor.class)
      public @interface TestEntity {}


      @Around({BijectionInterceptor.class, ValidationInterceptor.class,
       ConversationInterceptor.class, BusinessProcessInterceptor.class, LoggedInInterceptor.class})
      @Within({RemoveInterceptor.class})
      public class TestEntityInterceptor
      {
       public TestEntityInterceptor() {}
      
       @AroundInvoke
       public Object testing(InvocationContext invocation) throws Exception
       {
       System.out.println("INTERCEPTOR CALLED AT"+ invocation.getMethod());
       return invocation.proceed();
       }
      }