Savita, Yes you can cache a JoinPoint object in memory and use it whenever you like. In the attached email Matthew suggested you could do this, but he noted an issue you would face is that the related objects (getArgs, getThis, getTarget) can be mutable. So the objects the join point referenced can change state after you cache it, which probably wouldn't be want you want for a flight recorder.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chandan, Savita Sent: Tuesday, August 15, 2006 11:31 AM To: [email protected] Subject: RE: [aspectj-users] thisJoinPointStaticPart Eric, Would this also mean that I can cache thisJoinPoint in memory and then use it later long after the advise is done? Or should this be used within the scope of the advice? I have attached the response I received earlier on this. Thanks, Savita -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Bodden Sent: Tuesday, August 15, 2006 6:31 AM To: [email protected] Subject: RE: [aspectj-users] thisJoinPointStaticPart Note that in such a situation it's no problem to capture the "thisJoinPoint" object in the advice and then pass it to the method as an argument. Eric > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:aspectj-users- > [EMAIL PROTECTED] On Behalf Of Conway. Fintan (IT Solutions) > Sent: Tuesday, August 15, 2006 5:56 AM > To: [EMAIL PROTECTED]; [email protected] > Subject: RE: [aspectj-users] thisJoinPointStaticPart > > Doh, > > Of course it is! I was trying to use it in a method called from an > advice. > > Sometimes it is the simple things that trip us up. > > Many thanks, > > Fintan > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Wes > Sent: 15 August 2006 09:58 > To: [email protected] > Subject: Re: [aspectj-users] thisJoinPointStaticPart > > > Hi - > > this..JoinPoint.. reflective variables are only valid in the body of > advice, as discussed here: > > http://www.eclipse.org/aspectj/doc/released/progguide/semantics- > advice.h > tml#reflective-access-to-the-join-point > > thisJoinPoint{StaticPart} refers to the join point being advised, and > thisEnclosingJoinPointStaticPart refers to the join point enclosing the > current one, if known. They are of type JoinPoint or > JoinPoint.StaticPart. > > Does that help? - wes > > > ------------Original Message------------ > From: "Conway. Fintan (IT Solutions)" <[EMAIL PROTECTED]> > To: [email protected] > Date: Tue, Aug-15-2006 1:43 AM > Subject: [aspectj-users] thisJoinPointStaticPart Hi *, > > I am trying to retrieve the method which is firing an advice. I am > trying to use 'thisJoinPointStaticPart.toString()'. > > When I type thisJoinPointStaticPart into Eclipse it shows up in bold > and purple - so far so good. However when I save the aspect file, > Eclipse gives me the error - " > thisJoinPointStaticPart cannot be resolved" . I have imported > org.aspectj.lang.*; I am using Eclipse 3.2 and AJDT 1.4. Any advice > (pun > intended) is appreciated, Regards, Fintan PS same problem for > thisJoinPoint. > > _______________________________________________ > aspectj-users mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/aspectj-users > > > * ** *** ** * ** *** ** * ** *** ** * > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. > Any views or opinions presented are solely those of the author, and do > not necessarily represent those of ESB. > If you have received this email in error please notify the sender. > > Although ESB scans e-mail and attachments for viruses, it does not > guarantee that either are virus-free and accepts no liability for any > damage sustained as a result of viruses. > > * ** *** ** * ** *** ** * ** *** ** * > > _______________________________________________ > 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 _______________________________________________ aspectj-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/aspectj-users
