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.JoinPoint;
- import org.aspectj.lang.annotation.After;
- import org.aspectj.lang.annotation.AfterReturning;
- import org.aspectj.lang.annotation.Aspect;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.context.annotation.Configuration;
- @Aspect
- @Configuration
- public class AfterAOPAspect {
- private Logger logger = LoggerFactory.getLogger(this.getClass());
- @AfterReturning(value =
- "com.pig.spring.springaop.springaop.aspect.CommonJoinPointConfig.businessLayerExecution()"
- ,returning = "result")
- public void afterReturning123(JoinPoint joinPoint,Object result) {
- logger.info("{} returned with value {}",joinPoint,result);
- }
- @After(value =
- "com.pig.spring.springaop.springaop.aspect.CommonJoinPointConfig.businessLayerExecution()"
- )
- public void afterReturning123(JoinPoint joinPoint) {
- logger.info("after execution of {}",joinPoint);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement