1 Reply Latest reply on Mar 31, 2010 1:51 PM by bitec

    Custom interceptor does not work on methods for POJO

    bitec

      Hi.


      I'm creating the interceptor. It works ok for TYPE, but not for METHOD. I mean this:




      @Name("customerDetailsBean")
      @Scope(ScopeType.CONVERSATION)
      @DbExceptionCatch
      public class CustomerDetailsBean {..}
      
      // WORKS! The interceptor is called many times!







      @DbExceptionCatch
           public void someMethod()
      // DOES NOT WORK! Interceptor is never called.




      Here are annotation and interceptor themselves:




      @Target({METHOD, TYPE})
      @Retention(RUNTIME)
      @Interceptors(DataFetchExceptionInterceptor.class)
      public @interface DbExceptionCatch {)
      
      @Interceptor
      public class DataFetchExceptionInterceptor extends AbstractInterceptor {
      
           @AroundInvoke
           public Object aroundInvoke(InvocationContext ic) throws Exception {
                // TODO Auto-generated method stub
                return null;
           }
      ..
      }



      What am I doing wrong! Any help appreciated!