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