Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Initialization + Annoation Pointcut

Your current pointcut reads:

after execution of a *constructor that is annotated by WebService
annotation* and not within the HOGAspect type.

I think you want it to read:

after execution of a *constructor in a type annotated with WebService
annotation*

or: after(): execution(*.new(..)) && @within(WebService)

your pointcut would match if each individual constructor had @WebService on it.

Andy.


2009/5/14 Evan Moseman <evan.moseman@xxxxxxxxx>:
> I'm trying to write a pointcut that will inject advice after any class with
> the @WebService annotation is instantiated.
>
> I've tried dozens of different combinations of pointcut logic and nothing
> seems to work correctly.
>
> My latest attempt is this:
>
> after() : execution(*.new(..)) && @annotation(WebService) &&
> !within(HOGAspect)
>
> I would also be wiling to use a class name wildcard like ?ServiceImpl but I
> can't a match for that either.
>
> The purpose of the advice is to instantiate a performance collection object
> for each of these classes that is instantiated.  Then another pointcut will
> catch all of the method executions and collection stats about timing,etc...
>
> I thought that aspectj would be a perfect match for this, but 3 hours and
> many attempts later and nothing is matching.
>
> Any help / ideas are greatly appreciated, thanks!
>
> --
> Evan
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top