9 Replies Latest reply on Aug 30, 2007 9:29 PM by chen hong

    the intercept component don't work!

    chen hong Newbie

      my test intercept:
      @Name("interceptsTest")
      @Interceptor
      public class InterceptsTest {
      @Logger
      Log log;


      @AroundInvoke
      public Object doLogs(InvocationContext inv) throws Exception {
      int methodModify = inv.getMethod().getModifiers();
      String methodName = inv.getMethod().getName();

      if (methodModify == Modifier.PUBLIC
      && (methodName.startsWith("create")
      || methodName.startsWith("update")
      || methodName.startsWith("persist")
      || methodName.startsWith("remove"))) {

      Map data = inv.getContextData();
      Object target = inv.getTarget();
      log.debug("ContextData:" + data);
      log.debug("Target:" + target);
      }

      return inv.proceed();
      }

      }


      my invoke intercept class:

      @Name("useIntercept")
      @Interceptors(InterceptsTest.class)
      public class UseIntercept {

      public void persist() {
      System.out.println("&&&&&&&&&&&& do persist() &&&&&&&&&&&&");
      }

      }

      but when the persist() is executed,the intercept don't be invoked

      can you help me?