标签:err str 前置 aspect 清单 aspectj class ota poi
import org.aspectj.lang.annotation.*; @Aspect public class Notifier { @Before("execution(static void *..*.main(String[]))") public void before(){ System.out.println("Application is running!"); } @After("execution(static void *..*.main(String[]))") public void after(){ System.out.println("execute end!"); } @AfterReturning("execution(static void *..*.main(String[]))") public void afterReturning(){ System.out.println("return end!"); } @AfterThrowing("execution(static void *..*.main(String[]))") public void afterThrowing(){ System.out.println("Exception"); } }
import org.aspectj.lang.annotation.*; @Aspect public class Notifier { @Pointcut("execution(static void *..*.main(String[]))") public void pointCup(){} @Before("pointCup()") public void before(){ System.out.println("Application is running!"); } @After("pointCup()") public void after(){ System.out.println("execute end!"); } @AfterReturning("pointCup()") public void afterReturning(){ System.out.println("return end!"); } @AfterThrowing("pointCup()") public void afterThrowing(){ System.out.println("Exception"); } }
标签:err str 前置 aspect 清单 aspectj class ota poi
原文地址:https://www.cnblogs.com/black-/p/9095797.html