Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Exposing Arguments to Advice

You can use the following pointcut:

pointcut sendTransaction(TransactionManager tm, String foo):
execution(* TransactionManager.sendTransaction(String, ..)) && target(tm) && args(foo, ..);

-Ramnivas

===
Ramnivas Laddad,
Author, AspectJ in Action
http://ramnivas.com
M: (408)203-4621



Wilkerson, Cory wrote:

Hello All,

I'm fairly new to the world of AspectJ - quite fond of it thus far -
but, I've hit the wall WRT a particular issue; here's to hoping that a
wise AspectJ-sage can get me through.
In short, I'd like to be able to write a pointcut that looks something
like the following:

pointcut sendTransaction(TransactionManager tm, String foo):
execution(* TransactionManager.sendTransaction(String, ..)) && target(tm) && args(foo);

Instead, based on my limited knowledge, I'm having to write (Note
argument "bar" in this example):
pointcut sendTransaction(TransactionManager tm, String foo, String bar):
execution(* TransactionManager.sendTransaction(String, String)) && target(tm) && args(foo, bar);

I know that's probably crazy-talk but just wanted to ensure that if I
plan on exposing the arguments of a method to the advice, it's an
all-or-nothing scenario.

Thanks for any help,
Cory Wilkerson
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top