blob: b08047d6b7e75f3a8ac88639eaa003df897c9441 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
public aspect ServiceInterceptorCodeStyle {
void around(): execution(void Service.method(long)) {
Object[] args = thisJoinPoint.getArgs();
long id = (Long) args[0];
System.out.println("in advice, arg = " + id + " (before proceed)");
proceed();
System.out.println("in advice (after proceed)");
}
}
|