package com.hc.jee.springaop.aspect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class LoggingAspect {


	
	@AfterReturning(pointcut="args(name)", returning="returnString")
	public void stringArgumentMethods4(String name, String returnString) {
		System.out.println("A method that takes String arguments has been called. The value is " + name + ". The output value is " + returnString);
	}
	
	
	@AfterThrowing(pointcut="args(name)", throwing="ex")
	public void stringArgumentMethods5(String name, RuntimeException ex) {
		System.out.println("An exception has been thrown " + ex);
	}
	

}
