Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. package com.pig.spring.springaop.springaop.aspect;
  2.  
  3. import org.aspectj.lang.JoinPoint;
  4. import org.aspectj.lang.annotation.After;
  5. import org.aspectj.lang.annotation.AfterReturning;
  6. import org.aspectj.lang.annotation.Aspect;
  7. import org.slf4j.Logger;
  8. import org.slf4j.LoggerFactory;
  9. import org.springframework.context.annotation.Configuration;
  10.  
  11. @Aspect
  12. @Configuration
  13. public class AfterAOPAspect {
  14.  
  15. private Logger logger = LoggerFactory.getLogger(this.getClass());
  16.  
  17. @AfterReturning(value =
  18. "com.pig.spring.springaop.springaop.aspect.CommonJoinPointConfig.businessLayerExecution()"
  19. ,returning = "result")
  20. public void afterReturning123(JoinPoint joinPoint,Object result) {
  21. logger.info("{} returned with value {}",joinPoint,result);
  22. }
  23.  
  24. @After(value =
  25. "com.pig.spring.springaop.springaop.aspect.CommonJoinPointConfig.businessLayerExecution()"
  26. )
  27. public void afterReturning123(JoinPoint joinPoint) {
  28. logger.info("after execution of {}",joinPoint);
  29. }
  30.  
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement