[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] Question about constructor pointcuts
|
- From: "Andy Kriger" <andy.kriger@xxxxxxxxx>
- Date: Tue, 25 Nov 2008 10:57:57 -0500
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=y1VudUPlFRN/zOfqyaflTNQgm45urAbFL7QBMm5Bjp4=; b=xtNKYW5TylH49Gi4D7SlHwyPFdEKMEwACnBXH0M63Jah2Vc3/ST9LLXMnNCK3Tiu8e 8yCUv2kkCeXbPTvvnRHMu6EjvfmKyMbnDwBATXeJGjTnrwHjkFLQ+r+HxshNOcp21bNP w+QIFThLwwxECi/57xvNkYSp/Rw3KzMA6fGO8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=R+mbIGhOH6zPCoJaGTIfw7v5M1Gl+5sXwGLDbydvN122IY9BzFW282zGqVWt7A++nV PQAs+Y49uZYRHj2H4biqrEZjWfosrYPy2Hx/5/j3nu8MxJUsrnidAMBTEhIQTHRVofcx PKUSFmGrhI3xOE93x4E3KXCFjAh4QMhnoXTd8=
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.