Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Passing state between around advise

There are several approaches. Either combine aspect instance variables and change the instantiation model to "perthis" or "pertarget". Or stay with the default singleton aspect instantiation model and use ThreadLocal variables to store state.

I am not anywhere near a PC, so I cannot provide sample code right now, but maybe you knkw where to go from here by reading documentation or googling. :-)
--
Alexander Kriegisch

Am 23.11.2012 um 11:10 schrieb Brian Toal <brian.toal@xxxxxxxxx>:

> I want to share contextual information between Around advice invocations for the same thread.  For example I'm interested in storing the signature from previous advice execution for the same thread so I can log caller method corresponding to the current callee.
> 
> I don't fully understand if the proceed API with arguments allows info to be exchanged between  subsequent advice calls or if its intent is to override the agreements passed to the point cut?
> 
> The other option potentially i would need to maintain a aspect instance per thread and could have a member that contained the previous signature.
> 
> Looking for suggestions on how to accomplish this.
> 
> Thanks.
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top