Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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.

 

 


Back to the top