[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [aspectj-users] Newbie Method Call Question.
|
Hi Michael,
The code you showed looks right to me. Does it work if you just use Action? Can you post a snippet of code from the actual example.
I suggested using the this PCD because static methods for Action classes are quite rarely used, but if you _are_ using a static method, then Matthew's suggestion is the right way to go.
Ron Bodkin
Chief Technology Officer
New Aspects of Software
o: (415) 824-4690
m: (415) 509-2895
> ------------Original Message------------
> From: "Michael Finger" <mfinger@xxxxxxxxxxxxxxxx>
> To: <aspectj-users@xxxxxxxxxxx>
> Date: Wed, Jun-2-2004 2:35 PM
> Subject: RE: [aspectj-users] Newbie Method Call Question.
>
> Ron,
>
> Thanks for the tip - I was approaching from the wrong side.
> One more quick question - my action classes all extend a base class -
> UtilitiesAction
> so I want to do something like
>
> before(UtilitiesAction caller) : call(* businessMethod()) &&
> this(caller) {
> logger.log("Call from "+caller.getClass());
> }
>
> so I pick up all the action classes that extend it (i.e. all of them)
> but nothing seems to
> be matching up.
>
> Thanks for the tip,
> Michael
>
>
>
> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx
> [mailto:aspectj-users-admin@xxxxxxxxxxx]On Behalf Of Ron Bodkin
> Sent: Wednesday, June 02, 2004 1:24 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] Newbie Method Call Question.
>
>
> Michael,
>
> How about just using getClass() on the value of this at the call join
> point, e.g.,
>
> before(Action caller) : call(* businessMethod()) && this(caller) {
> logger.log("Call from "+caller.getClass());
> }
>
> Ron Bodkin
> Chief Technology Officer
> New Aspects of Software
> o: (415) 824-4690
> m: (415) 509-2895
>
> > ------------Original Message------------
> > From: "Michael Finger" <mfinger@xxxxxxxxxxxxxxxx>
> > To: <aspectj-users@xxxxxxxxxxx>
> > Date: Wed, Jun-2-2004 12:11 PM
> > Subject: [aspectj-users] Newbie Method Call Question.
> >
> > Hello,
> > I have a hopefully simple aspectj question I haven't been able to
> figure out:
> >
> > I'm using struts and have the typical action class that call business
> objects.
> >
> > I've written some aspects that tell me when methods are being called
> in the business objects, this works fine, but I'm also interested in the
> names of the action classes that are calling the business object
> methods. In debugging situations I don't always know what action classes
> are calling the business objects, so an aspect that can spit out this
> info is of great value.
> > Is there an easy way to do this? I've played with the thisJoinPoint.
> >
> > Thanks,
> > Michael FInger
> >
> > Michael Finger - Software Development, SV Technology
> >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > http://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
> >
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>