Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.pig.spring.springaop.springaop.aspect;
- import org.aspectj.lang.ProceedingJoinPoint;
- import org.aspectj.lang.annotation.Around;
- import org.aspectj.lang.annotation.Aspect;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.context.annotation.Configuration;
- @Aspect
- @Configuration
- public class MethodExecutionCalculationAspect {
- private Logger logger = LoggerFactory.getLogger(this.getClass());
- @Around("com.pig.spring.springaop.springaop.aspect.CommonJoinPointConfig.businessLayerExecution()")
- public void around(ProceedingJoinPoint joinPoint) throws Throwable {
- long startTime = System.currentTimeMillis();
- joinPoint.proceed();
- long timeTaken = System.currentTimeMillis() - startTime;
- logger.info("Time taken is {} is {}",joinPoint,timeTaken);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement