From c32e8d9b55cec5e93530a486c08936965a2b1025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=BE=BD=E9=93=96?= Date: Wed, 25 Sep 2019 10:05:38 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=88=87=E9=9D=A2after=E5=88=87?= =?UTF-8?q?=E7=82=B9=EF=BC=8C=E5=B0=86=E7=9B=AE=E6=A0=87=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E8=BF=94=E5=9B=9E=E5=80=BC=EF=BC=8C=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E7=BB=99=E5=88=87=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hutool-aop/src/main/java/cn/hutool/aop/aspects/Aspect.java | 3 ++- .../src/main/java/cn/hutool/aop/aspects/SimpleAspect.java | 2 +- .../main/java/cn/hutool/aop/aspects/TimeIntervalAspect.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hutool-aop/src/main/java/cn/hutool/aop/aspects/Aspect.java b/hutool-aop/src/main/java/cn/hutool/aop/aspects/Aspect.java index ebb020b3f..aea0d826b 100644 --- a/hutool-aop/src/main/java/cn/hutool/aop/aspects/Aspect.java +++ b/hutool-aop/src/main/java/cn/hutool/aop/aspects/Aspect.java @@ -26,9 +26,10 @@ public interface Aspect{ * @param target 目标对象 * @param method 目标方法 * @param args 参数 + * @param returnVal 目标方法执行返回值 * @return 是否允许返回值(接下来的操作) */ - boolean after(Object target, Method method, Object[] args); + boolean after(Object target, Method method, Object[] args, Object returnVal); /** * 目标方法抛出异常时的操作 diff --git a/hutool-aop/src/main/java/cn/hutool/aop/aspects/SimpleAspect.java b/hutool-aop/src/main/java/cn/hutool/aop/aspects/SimpleAspect.java index b327e9c02..4e5d2bc93 100644 --- a/hutool-aop/src/main/java/cn/hutool/aop/aspects/SimpleAspect.java +++ b/hutool-aop/src/main/java/cn/hutool/aop/aspects/SimpleAspect.java @@ -20,7 +20,7 @@ public class SimpleAspect implements Aspect, Serializable{ } @Override - public boolean after(Object target, Method method, Object[] args) { + public boolean after(Object target, Method method, Object[] args, Object returnVal) { //继承此类后实现此方法 return true; } diff --git a/hutool-aop/src/main/java/cn/hutool/aop/aspects/TimeIntervalAspect.java b/hutool-aop/src/main/java/cn/hutool/aop/aspects/TimeIntervalAspect.java index 4ea3fac91..df239984b 100644 --- a/hutool-aop/src/main/java/cn/hutool/aop/aspects/TimeIntervalAspect.java +++ b/hutool-aop/src/main/java/cn/hutool/aop/aspects/TimeIntervalAspect.java @@ -22,7 +22,7 @@ public class TimeIntervalAspect extends SimpleAspect{ } @Override - public boolean after(Object target, Method method, Object[] args) { + public boolean after(Object target, Method method, Object[] args, Object returnVal) { Console.log("Method [{}.{}] execute spend [{}]ms", target.getClass().getName(), method.getName(), interval.intervalMs()); return true; }