[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-dev] Re: [NEWSDELIVER] Is there any usage like the following in AspectJ?
|
Zifu,
What you request may already be possible.
The "thisJoinPoint" construct can be used within an "if()"
pointcut as well as advice:
pointcut
mypointcutB():
execution(* A.method1()) && if(thisJoinPoint.getSignature()!=null);
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/
Please respond to AspectJ
developer discussions <aspectj-dev@xxxxxxxxxxx>
Sent by:
aspectj-dev-bounces@xxxxxxxxxxx
To:
Matthew Webster/UK/IBM@IBMGB
cc:
aspectj-dev@xxxxxxxxxxx
Subject:
[aspectj-dev]
Re: [NEWSDELIVER] Is there any usage like the following
in AspectJ?
Here is an example for the second idea.
pointcut mypointcutA():
cflow(execution(A.method1()) && within(B))
pointcut mypointcutB():
execution(A.method1()) && if(mypointcutA.getSignature()!=null)
in mypointcutB, we take mypointcutA as a
reference. this reference
has the same functionality as thisJoinPoint.
On 1/20/06, Matthew Webster <matthew_webster@xxxxxxxxxx>
wrote:
Zifu,
Your first idea sounds like "pcflow()" or predictive cflow: http://www.st.informatik.tu-darmstadt.de/database/publications/data/PQL.pdf?id=100
. I'm not quite about your
second idea. Can you elaborate?
BTW I have posted this t aspectj-dev which is a better place to discuss
possible AspectJ enhancements.
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/
Please respond to "Zifu
Yang" <zifu.yang@xxxxxxxxx
>
To:
undisclosed-recipients:;
cc:
Subject: [NEWSDELIVER]
Is there any usage like the following in AspectJ?
pointcut mypointcut(): execution(A.method1()) && if
(exists(cflow(execution(A.method1()) && within(B)))
My question is about the "exists". Is there any way to
know if some
pointcut exists or not when defining
the pointcut?
My intention is that I want to generate execution( A.method1()) depending
on
if cflow(execution(A.method1()) && within(B)) exists.
As we know, "thisJoinPoint" can give us some useful information.
But I really hope there is some usuage model for getting information from
any join point,not only for thisJoinPoint in an
advice block.
for example, mypointcut().getXXXXX().
--
best regards,
Zifu Yang _______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev