SHARE
TWEET

Untitled

a guest Mar 19th, 2019 64 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.ProceedingJoinPoint;
  4. import org.aspectj.lang.annotation.Around;
  5. import org.aspectj.lang.annotation.Aspect;
  6. import org.slf4j.Logger;
  7. import org.slf4j.LoggerFactory;
  8. import org.springframework.context.annotation.Configuration;
  9.  
  10. @Aspect
  11. @Configuration
  12. public class MethodExecutionCalculationAspect {
  13.    
  14.     private Logger logger = LoggerFactory.getLogger(this.getClass());
  15.  
  16.     @Around("com.pig.spring.springaop.springaop.aspect.CommonJoinPointConfig.businessLayerExecution()")
  17.     public void around(ProceedingJoinPoint joinPoint) throws Throwable {
  18.         long startTime = System.currentTimeMillis();
  19.         joinPoint.proceed();
  20.         long timeTaken = System.currentTimeMillis() - startTime;
  21.         logger.info("Time taken is {} is {}",joinPoint,timeTaken);
  22.     }
  23. }
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