This topic has not yet been written. The content below is from the topic description.
Execution pointcuts on methods and constructors are very useful, but limiting some times. For instance, what if you don't want a method to be intercepted once you are within the method's class? Another problem is that JBoss AOP does not allow you to have an execution pointcut applied to any Java system classes. This is where caller pointcuts come in. Executions are invoked whenever the method is called within the method itself. Callers are invoked at the point of the calling code. Callers allow you to specify what method in what class calls whatever method. Confused? Here's some examples from jboss-aop.xml. Whenever ArrayList.size() method is called from within the Driver.caller() method, invoke CallerInterceptor1. You see? You can specify the point of interception from within the caller's code. You can also use boolean expressions to specify your within: This binding states to invoke CallerInterceptor2 whenever ArrayList.size() is called from within any Driver class method, but not from within Driver.caller(). This binding is a little different in that it uses the within keyword rather than the withincode keyword. Within matches anything within an entire class. So the above pointcut states, whenever the ArrayList empty constructor is called from within any method or constructor of the Driver class.