i’m successfully intercepting the static initialization of classes with @MyAnnotation with this code:
public aspect SomeAspect {
pointcut printClassName() : staticinitialization(@MyAnnotation *);
after() : printClassName() {
System.out.println(getClass().getName());
}
}
The question is: how do i get the name of the loaded class? In the code above what’s printed is the name of the aspect class, not the name of the loaded class.
Thanks,
Teo
You should use thisJoinPoint to get these type of information. This code does the trick.