Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] example pointcut

Hi all!

I wish to trace all calls to public methods in package com.donv and all

I have an aspect:

package no.milron.espresso.aspects;

aspect LogAspect {
  public interface LogObject {}
  declare parents: com.donv..* implements LogObject;

  pointcut logPoints(LogObject l) :
    && (execution(public * *(..)) || execution(public static * *(..)))
    && !within(LogAspect)

  before() : logPoints() {
    System.out.println("AspectJ Log " + thisJoinPoint);

In a servlet com.donv.espresso.servlets.EspressoServlet I have static calls
to that I wish to trace.  The above aspect
logs the call to EspressoServlet.init(..), but not to

Can somebody explain why not, and give me a working example?

With kind regards,

Uwe Kubosch

Uwe Kubosch
Adviser eCommerce
ICQ#: 71437007
More ways to contact me:

Back to the top