9 Replies Latest reply on Oct 11, 2010 3:37 AM by dapeng liu

    Interceptor is not invoked within same bean

    dapeng liu Newbie

      i have implemented a very simple LogAccess interceptor, which i want to record the method invocations.

      codes below. when i call the m1(), i only got the m1 logged, not m2 ...

      so is this the limitation of the CDI interceptor impl ?

      glassfish 3.0.1 opensource edition

      public class MyBean {
          public String m1() {
              return m2();
          public String m2() {
              return "hello world";
      public class LogAccessInterceptor {
          Logger logger = Logger.getLogger("LogAccess");
          public Object logAccess(InvocationContext ic) throws Exception {
              return ic.proceed();
      @Target({ElementType.METHOD, ElementType.TYPE})
      public @interface LogAccess {