Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Pointcuts for Annotated Interface Methods

Title: Pointcuts for Annotated Interface Methods

Hi,

We would like to apply transactional control to certain public methods defined in our API … there are quite a lot of methods involved and a lot more implementations of these methods.

I was hoping to put an annotation on the required methods and use an annotation based pointcut to select the methods which should have the relevant advice applied.

BUT … annotations are not inherited from interfaces to their implementing classes so this will not work.

Is there any obvious way to resolve this … I really don't want to go down the road of adding the Annotation to each and every implementing method.

E.g. is there some AspectJ way to select an annotated method and implementers of that method??

I tried using

   pointcut tx():
        @annotation(Transactional);

But that only picks out calling join points, and we want to provide this on execution join points as the code which will be using our API is not available to us at build time.

/David



Back to the top