Thanks .. works like a charm .. On 12/3/06, Eric Bodden <[EMAIL PROTECTED]> wrote:
Did you try... initialization(Interface+.new(..)) && !initialization(Interface.new(..)) ...? Eric > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:aspectj-users- > [EMAIL PROTECTED] On Behalf Of Debasish Ghosh > Sent: Saturday, December 02, 2006 3:32 PM > To: [email protected] > Subject: [aspectj-users] Initialization Join Points for Interfaces .. > > Hi - > > I have a question regarding initialization pointcuts for interfaces. > > Suppose I have an initialization pointcut as : > > initialization(Interface+.new(..)), where Interface is a Java interface > and I have a class as : > > public class Implementation implements Interface { > // ... > } > > In this case I get 2 initialization joinpoints - one for the interface > and the other for the implementation. In case, in the after-returning > advice, I would like to ignore the interface specific one, what is the > best practice for doing this ? I do not want to introduce the > implementation class within the advice, since I can have multiple > implementations of this interface. I came up with the following .. > > after(Interface client) returning : > clientCreation(client) { > if ("org.dg.biz.Interface".equals( > thisJoinPoint.getSignature().getDeclaringTypeName())) { > return; > } > // .. rest of the advice > } > > However, I do not like this string comparison. Is there a better way to > achieve this ? > > Thanks. > - Debasish
_______________________________________________ aspectj-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/aspectj-users
