SHARE
TWEET

Untitled

a guest Mar 19th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top