// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import org.aspectj.lang.*;
import org.aspectj.lang.annotation.*;

@Aspect
public class Current {
    private static String clznam;
    private static String mthnam;
    @Pointcut("call(public * *.*(..)) && !within(Current) && !call(public * Current.*(..)) && !call(public * java.lang.*.*(..))")
    public void allcalls() { };
    @Before("allcalls()")
    public void beforeCall(JoinPoint thisJoinPoint) {
        clznam = thisJoinPoint.getSignature().getDeclaringTypeName();
        mthnam = thisJoinPoint.getSignature().getName();
    }
    public static String getClznam() {
        return clznam;
    }
    public static String getMthnam() {
        return mthnam;
    }
}
