Skip to main content

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

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

Attachment: pgp8Hy2QMeWYU.pgp
Description: PGP signature


Back to the top