[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [aspectj-users] thisJoinPointStaticPart
|
Mathew,
This was meant for dealing with object parameters. In order
to log the object parameters,
I need to find out which parameters are objects and then
save its snapshot and buffer it for logger or buffer its identity and
retrieve the snapshot later.
In either case, I have to do it before buffering the
joinpoint. Like you suggested I can still buffer the joinpoint for
primitive and immutable parameters.
Another approach I have been thinking
about that would put the onus on the user, is to specify in
the annotations which are the objects params they would like to log . The
framework would then use reflection during run time only if objects are involved
and take the hit. Otherwise it just buffers the joinpoint.
This would simplify the code and its maintenance a great
deal.
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx]
On Behalf Of Matthew Webster
Sent: Wednesday, August 16, 2006
2:39 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE:
[aspectj-users] thisJoinPointStaticPart
Savita, >The solution I was thinking of was to use 'apt' before compilation
to
>generate advise code for each annotated method. The parameters for
each
>method would be resolved using reflection during the
precompilation
>step, where the code gets generated. I don't understand the purpose of this. What advantage
does this offer over using thisJoinPoint? Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM
Hursley Park, Winchester, SO21 2JN, England
Telephone: +44 196 2816139
(external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB,
matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/
"Chandan, Savita"
<Savita.Chandan@xxxxxxxxxxxxxx> Sent by: aspectj-users-bounces@xxxxxxxxxxx
15/08/2006 20:40
Please respond
to aspectj-users@xxxxxxxxxxx |
|
To
| <aspectj-users@xxxxxxxxxxx>
|
cc
|
|
Subject
| RE: [aspectj-users]
thisJoinPointStaticPart |
|
Oops sent it before completing the response.
The solution I was
thinking of was to use 'apt' before compilation to
generate advise code for
each annotated method. The parameters for each
method would be resolved using
reflection during the precompilation
step, where the code gets generated.
Next step is to run ajc to weave
the code. This way I don't have to use
reflection during run time, but
the draw back is I will be generating lot of
code. Cant think of any
other solution.
Any ideas/ feedback on this is
most welcome.
Iam currently working to see if this is a feasible
solution.Iam new to
both using annotations, apt and AspectJ and Iam exploring
how to code
for all of this.
Any useful guides to speed up my learning
process are welcome as well.
Thanks,
Savita
-----Original
Message-----
From:
aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx]
On Behalf Of Chandan, Savita
Sent: Tuesday, August 15, 2006 12:26 PM
To:
aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users]
thisJoinPointStaticPart
Thanks for your response.
In the use case
where the objects are going to be logged Iam looking at
a different
strategy.
-----Original Message-----
From:
aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx]
On Behalf Of Ron Bodkin
Sent: Tuesday, August 15, 2006 11:35 AM
To:
aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users]
thisJoinPointStaticPart
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:
aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx]
On Behalf Of Chandan, Savita
Sent: Tuesday, August 15, 2006 11:31 AM
To:
aspectj-users@xxxxxxxxxxx
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:
aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx]
On Behalf Of Eric Bodden
Sent: Tuesday, August 15, 2006 6:31 AM
To:
aspectj-users@xxxxxxxxxxx
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: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-
> bounces@xxxxxxxxxxx] On Behalf Of Conway. Fintan
(IT Solutions)
> Sent: Tuesday, August 15, 2006 5:56 AM
> To:
wes@xxxxxxxxxxxxxx; aspectj-users@xxxxxxxxxxx
> 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:
aspectj-users-bounces@xxxxxxxxxxx
>
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Wes
> Sent: 15
August 2006 09:58
> To: aspectj-users@xxxxxxxxxxx
> 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)" <Fintan.Conway@xxxxxx>
> To:
aspectj-users@xxxxxxxxxxx
> 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
> aspectj-users@xxxxxxxxxxx
>
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
> aspectj-users@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users
mailing
list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users
mailing
list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users
mailing
list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users
mailing
list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users