You can declare predefined lists of interceptors can be referenced in any bindings.
<stack name="stuff"> <interceptor class="SimpleInterceptor1"/> <interceptor class="SimpleInterceptor2"/> <interceptor class="SimpleInterceptor3"/> </stack> <bind pointcut="execution(* POJO->*(..))"> <stack-ref name="stuff"/> </bind>
The <stack> element just defines a set of interceptors/advices. You can reference it from within a binding via a <stack-ref> element.
To compile and run (for further detail, refer to our Compiling and Running Examples Guide):
$ ant run.aopc
It will javac the files and then run the AOPC precompiler to manipulate the bytecode, then finally run the example. The output should be similar to this:
_run.aopc: [java] SimpleInterceptor1 [java] SimpleInterceptor2 [java] SimpleInterceptor3 [java] someMethod()