[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] quick question about callers of a method that has a point cut.
|
You can do this several ways. If
you want the caller exposed to the advice, you can try:
pointcut test(Object caller) : call(
* MyClass.myMethod(..) ) && this(caller);
You can also use this(ObjectPattern)
to just restrict the callers (or within()).
cheers,
-adrian.
--
Adrian Powell
Centre for IBM e-Business Innovation :: Vancouver
apowell@xxxxxxxxxx / 604-297-3194
Adam Jenkins <ajenkins@xxxxxxxxxxxx>
Sent by: aspectj-users-admin@xxxxxxxxxxx
11/04/2004 06:50 PM
Please respond to
aspectj-users |
|
To
| "'aspectj-users@xxxxxxxxxxx'"
<aspectj-users@xxxxxxxxxxx>
|
cc
|
|
Subject
| [aspectj-users] quick question
about callers of a method that has a point cut. |
|
Hi,
Is there anyway in aspectj to retrieve data
about the caller of the method you have a pointcut on (apart from creating
an exception and traversing the stack trace). We need different code
to execute based on the caller of an objects getters/setters and are trying
to figure if aspects would be a good channel to travel for this functionality.
Cheers
Adam
Important notice: This message
is intended for the individual(s) and entity(s) addressed. The information
contained in this transmission and any attached, may be confidential and
may also be the subject of legal privilege, public interest immunity or
legal professional privilege. Any review, retransmission, dissemination
or other use of, taking of any action in reliance upon this information
by person or entities other than the recipient is prohibited and requires
authorization from the sender. If you are not the addressee indicated in
this message (or responsible for delivery of the message to such person)
you may not copy or deliver this message to anyone. In such cases you should
destroy this message and kindly notify the sender by reply email.
WARNING: Although Infocomp has
taken reasonable precautions so that no viruses are present in this e-mail,
the company cannot accept responsibility for any loss or damage arising
from the use of e-mail attachments.