// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import java.lang.reflect.*;

import org.aspectj.lang.*;
import org.aspectj.lang.annotation.*;

@Aspect
public class Trace {
    @Pointcut("call(public * IntMath.*(..)) || call(public * DoubleMath.*(..))")
    public void mathtrace() { };
    @Before("mathtrace()")
    public void enter(JoinPoint thisJoinPoint) {
        System.out.println("Enter " + thisJoinPoint.getSignature());
    }
    @AfterReturning("mathtrace()")
    public void leave(JoinPoint thisJoinPoint) {
        System.out.println("Exit " + thisJoinPoint.getSignature());
    }
}
