Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] generate a StackTraceElement

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[quote Valerio Schiavoni::on 2/10/2005 6:44 PM]
| On Thursday 10 February 2005 16:29, Alexandru Popescu wrote:
|> The only available pointcut related to aspects is the adviceexecution() but
|> you cannot refine it further to match a before advice and after advice.
|
| i don't need to refine it. It'd be enough to be able to "dump" the stack
| everytime an advice is executed.
|
| i tried with :
|
| pointcut Advices(): adviceexecution() && within(TraceAspect);
|
|     after(): Advices() {
|           StackTraceElement ste = new StackTraceElement
| (thisJoinPoint.getSignature().getDeclaringType().getName(),
|                 thisJoinPoint.getSignature().getName(),
|                 thisJoinPoint.getSourceLocation().getFileName(),
|                 thisJoinPoint.getSourceLocation().getLine());
|          System.out.println("BeforeAndAfter advice: "+ ste);
| }
|
| so, if another advice is present, i want to get info about that join point.
| This is not possible? If so...why ?
|
| thanks,
| valerio

I think what you are looking for is something in this direction:

pointcut advices(JoinPoint jp): adviceexecution() && args(jp) && within(...)

- --
:alex |.::the_mindstorm::.|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCC6RYTTDTje0R2dgRAp8wAJ9CWE3CG6X9PJ/ml/CIoMIonv/kIQCfZwYi
dsqd+9JqRdFNJpKskcdhSHQ=
=mH0+
-----END PGP SIGNATURE-----


Back to the top