2 Replies Latest reply on Feb 22, 2007 8:36 AM by Denis Souza

    Annotations with interceptor behavior

    Denis Souza Newbie

      I was reading in Bill Burke's "Enterprise JavaBeans 3.0" book that I can create an annotation that will take on an interceptor's behavior by declaring the annotation itself with an interceptor such as in the example:

      @Interceptors(com.titan.interceptors.AuditInterceptors)
      public @interface Audit{
      }
      


      So that this:

      @Audit
      public Object myMethod(){
      }
      


      would be the same as placing the actual interceptor on my method. However, it's just not working for me. If I use a regular interceptor everything is fine, but if I try to do the annotation thing it doesn't work. The interceptor is simply not called.

      I also was carefull to create the annotation with a Runtime retention type and appropriate target but still, nothing.

      Any ideas on what I might be doing wrong?