3 Replies Latest reply on Jun 15, 2003 5:11 PM by Bill Burke

    using AspectManager class

    gustavodesimone Newbie

      Hi, I am trying to add Interceptors dynamically and couldn't figure out how to do it yet...

      This is what I am doing but I don't get any result.

      AspectManager am = AspectManager.instance();

      am.addInterceptorFactory("Test",new IterceptorFactory(){
      public Interceptor create(Advisor advisor) {
      return new TestInterceptor();
      }

      });

      InterceptorPointcut ip = new InterceptorPointcut("Testing", "test.Pojo", null, new String[]{"Test"},
      InterceptorFilter.NONE, InterceptorFilter.NONE, InterceptorFilter.NONE);

      am.addInterceptorPointcut(ip);
      Pojo pojo = new Pojo();
      pojo.helloWorld();

      Am I losing something?