Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Question about constructor pointcuts

Thank you for confirming my suspicion.

Can call work at compile-time if we're using a 3rd party library like
Spring that creates objects using its own code via reflection? Would
the call pointcut require compiling Spring's code w aspects (rather
than just our code)? Or would this require us to use run-time weaving?

On Tue, Nov 25, 2008 at 10:50 AM, Eric Bodden
<eric.bodden@xxxxxxxxxxxxxx> wrote:
>> Does the advice run before the constructor has finished, thus exposing
>> this in a non-threadsafe manner?
>
> AFAIK it doesn't. Your code will run just at the end of the
> constructor (inside it).
>
>> What is a better way to write this advice such that something happens
>> after the constructor has completed?
>
> after() returning(Listener l): call((@MyAnnotation *).new(..)) {
> ..
> }
>
> Eric
>
> --
> Eric Bodden
> Sable Research Group, McGill University, Montréal, Canada
> Got an interesting job offer? http://www.bodden.de/hire-me/
>



-- 
Be well,
andy

Welcome to http://householder-yogi.net
On family, NYC, and practicing yoga.


Back to the top