MethodInterceptor
方法攔截器,也就是aop攔截方法
1.使用示例
public interface MethodInterceptor extends Interceptor {
Object invoke(MethodInvocation invocation) throws Throwable;
}
只有一個方法invoke方法,這里和java web的過濾器很相像
Object ret = invocation.proceed();
在這個方法的前后加上邏輯,就是方法前和方法后需要執行的邏輯