That is going to result in a runtime test for the annotation.
Answering from an AspectJ point of view, the type involved at runtime
may be different to that involved at compile time (a subtype or impl)
so we can't statically match @target reliably.  Whether this could be
optimized in a Spring AOP scenario, I don't know.  A statically
matching pointcut would be:

within(@Service *)

cheers,
Andy

On 12 December 2011 09:11, Neale Upstone <[email protected]> wrote:
> Hi,
>
> Is there a reason why this seems to match all when using Spring proxy
> based AOP?
>
>        @Pointcut("@target(org.springframework.stereotype.Service)")
>        void service() {}
>
> I'd take a guess at it being something to do with the proxy target not
> being known at the point of creating the proxy, but it's not obvious.
>
> Cheers,
>
> Neale
>
> --
>  Neale Upstone
>  [email protected]
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to