Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Query A local variable

Unfortunately, it is not possible to access local variables directly inside advice.  The best that you can do is use a "set" joinpoint to capture the initial setting of the variable.  Then you store this value inside of your aspect.  Finally, you can use after advice on the method to retrieve the value that you stored.

This is similar to the wormhole patterm:
http://www.theserverside.com/tt/articles/article.tss?l=AspectOrientedRefactoringPart2



Could anyone tell me if its possible using AspectJ to query a local
variable. I have a local object created in a method and I would like to
retrieve the value of one of its fields at the end of the method.


Back to the top