2 Replies Latest reply on Dec 14, 2004 9:52 PM by dolphy

    I'd like to controll in order of interception

    dolphy

      Hi,
      I'm from Japanese.

      "annotation sample" in [jboss-aop_1.0.0-FINAL] sample directory

      Below is the code snippet of POJO.java.

      @trace @billable
      public void someMethod()
      {
      System.out.println("someMethod");
      }

      The output shows:

      [java] --- pojo.someMethod(); ---
      [java] billing...POJO_someMethod_2315001504750198986_OptimizedMethodInvocation@b89838
      [java] <<< Trace : executing method public void POJO.someMethod()
      [java] someMethod
      [java] >>> Leaving Trace

      I'd like to run @trace interceptor at first.
      I mean... the output is

      [java] --- pojo.someMethod(); ---
      [java] <<< Trace : executing method public void POJO.someMethod()
      [java] billing...POJO_someMethod_2315001504750198986_OptimizedMethodInvocation@b89838
      [java] someMethod
      [java] >>> Leaving Trace

      If possble, tell me how can I do that?
      I'm sory to bother that my poor English.

        • 1. Hello all, Sacha Labourey and I have written a companion w
          dolphy

          1

          • 2. Re: I'd like to controll in order of interception
            kabirkhan

            Hi,

            In the 1.0 release it is currently using the order of the interceptors defined in jboss-aop.xml, so you could try moving the binding with the traceinterceptor to the top:

            <?xml version="1.0" encoding="UTF-8"?>
            <aop>
             <bind pointcut="all(@trace)">
             <interceptor class="TraceInterceptor"/>
             </bind>
            
            
             <bind pointcut="execution(POJO->@billable(..))">
             <interceptor class="BillingInterceptor"/>
             </bind>
            
             <bind pointcut="execution(* POJO->@billable(..))">
             <interceptor class="BillingInterceptor"/>
             </bind>
            
            </aop>
            



            Apart from that I am currently in the process of adding 'precedence' to JBoss AOP, it is a global relative sorting order of interceptors. Check cvs a bit later this week and it should be in.