You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ServiceInterceptorCodeStyle.java 479B

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