[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Help with defining pointcut for method execution on interface hierarchy


I'd like to get some help to define a pointcut. I have an empty marker interface (A) from which several other interfaces extends e.g.

public interface B extends A {
      void myMethodInB();

Then I have an implementation of B (BImpl) which also extends other interfaces that doesn't extend from A such as X, Y, and Z, e.g.

public class BImpl implements B, X, Y, Z {
   public void myMethodInB() {

   public void myMethodInX() {

I want to define a pointcut that only intercepts methods declared in a subinterface of A. So for example the only method that should be intercepted in BImpl is the myMethodInB method since B extends A. The other methods such as myMethodInX should not be intercepted. Does anyone know how a pointcut like this would look like?