In case anyone is interested in this... apparently this can't be done. In order to use Java solely (and no XML class) you need to use AspectJ and Spring with @aspect annotations.
This is how the code ended up:
@Aspect
public class MyInterceptor {
@Pointcut(value = "execution(* *(..))")
public void anyMethod() {
// Pointcut for intercepting ANY method.
}
@Around("anyMethod() && @annotation(myAnnotation)")
public Object invoke(final ProceedingJoinPoint pjp, final MyAnnotation myAnnotation) throws Throwable {
//does some stuff
...
}
}
If anyone else finds out something different please feel free to post it!
Regards,
Lucas