import java.lang.reflect.Method; import org.springframework.aop.MethodBeforeAdvice; public class MethodBefore implements MethodBeforeAdvice { public void before(Method method, Object[] objects, Object object) throws Throwable { System.out.println(method); } public static void main(String[] args) throws Throwable { MethodBeforeAdvice advice = new MethodBefore(); Method[] methods =advice.getClass().getDeclaredMethods(); for (Method method : methods) { advice.before(method, args, advice); } } }
org.springframework.aop.MethodBeforeAdvice的简单实现
最新推荐文章于 2022-08-30 15:03:09 发布