That seems to have solved the issue. From
what I see you must know either the first and last param or list all params for
the method to join. I assume that you can pass two or more params into the
advice?
What does target(e) afford you?
Thanks,
Ed
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron Bodkin
Sent: Tuesday, October 17, 2006
11:15 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users]
Passing parameters
Try using args(.., e) to match this.
Args matches based on position and number
of arguments. Since Event is the last argument, you need to say args(.., e) to
match any number of arguments before it then match it last. Unfortunately you
can’t say args(.., e, ..) to match an argument anywhere (maybe this will
be revised in future).
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ed
Lauder
Sent: Tuesday, October 17, 2006
9:54 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users]
Passing parameters
Please note that the following code
compiles does not get woven. If I take the event parameter out, it
compiles and gets woven.
The following is the method I want to
wrapper with advice:
protected static State
processEvent(ClientSession clientSession, State state, Event event)
throws com.ereinsure.commons.exception.PlatformException
{
…
}
ClientSession, State, Event all exist
within the same package and I do import those classes.
here is my simplified aspect code:
pointcut
callProcessEvent(Event e) :
call(State processEvent(..)) && args(e);
before(Event event) : callProcessEvent(event)
{
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Before call of processEvent aspect");
System.out.println("Start Time in millis:
" + System.currentTimeMillis());
}
after(Event event) returning : callProcessEvent(event)
{
System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
After call of " + event.getName() + " aspect");
System.out.println("End Time in millis:
" + System.currentTimeMillis());
}
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron Bodkin
Sent: Tuesday, October 17, 2006
10:34 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users]
Passing parameters
Hi Ed,
Can you give us some example code? Are
there any compiler warnings? Did you import the types? What is the signature of
the execute method you are hoping to match?
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On
Behalf Of Ed Lauder
Sent: Tuesday, October 17, 2006
9:29 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users]
Passing parameters
Still cant get it woven.
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On
Behalf Of Eric Bodden
Sent: Tuesday, October 17, 2006
10:11 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users]
Passing parameters
You can use:
pointcut notifyExecute(Event e) :
call(StateTransition execute(..)) && args(e,...);
in that case. (assuming “e”
is the first parameter)
Eric
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ed
Lauder
Sent: Tuesday, October 17, 2006
12:01 PM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users]
Passing parameters
I tried that along with target(e).
The aspect compiles but does not get woven.
There are three params that get passed
into the method execute(). Do all three need to be passed into the
notifyExecute pointcut?
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Eric Bodden
Sent: Monday, October 16, 2006
9:04 PM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users]
Passing parameters
Try something like…
pointcut notifyExecute(Event e) :
call(StateTransition execute(..)) && args(e);
after(Event event)
returning : notifyExecute(event) {
System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Call after Execute aspect");
System.out.println("End Time in millis: " +
System.currentTimeMillis());
ystem.out.println(“Event was: “+event);
}
Eric
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On
Behalf Of Ed Lauder
Sent: Monday, October 16, 2006
4:43 PM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] Passing
parameters
I am trying to pass parameters from the point
cut into the after advice.
My point cut gets the correct classes that
I wish woven. The problem is getting the values passed in to point cut
into the advice.
Simply:
pointcut notifyExecute() :
call(StateTransition execute(..));
after() returning :
notifyExecute() {
System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Call after Execute aspect");
System.out.println("End Time in millis: " +
System.currentTimeMillis());
}
There is an Event param that gets passed
into the execute method and I would like to get access to the object within the
after advice.