MethodInterceptor-方法拦截器


MethodInterceptor

方法拦截器,也就是aop拦截方法

 

1.使用示例

public interface MethodInterceptor extends Interceptor {
      Object invoke(MethodInvocation invocation) throws Throwable;
}

只有一个方法invoke方法,这里和java web的过滤器很相像

Object ret = invocation.proceed();

在这个方法的前后加上逻辑,就是方法前和方法后需要执行的逻辑


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM