类 BeanMethodInterceptorChain

  • 直接已知子类:
    MultipleBeanMethodInterceptorChain

    public class BeanMethodInterceptorChain
    extends Object
    方法拦截器链:一个方法可以被多个拦截器拦截,多个拦截器之间顺序的组成了一条拦截器链,没个拦截器可以决定是否继续执行后面拦截器 Method the interceptor chain: one method can be more interceptors to intercept, between multiple interceptors sequence formed a chain of interceptors, behind each blocker can decide whether to continue the interceptor
    作者:
    Eva Wang
    • 字段详细资料

      • interceptorList

        protected List<BeanMethodInterceptor> interceptorList
        链中的拦截器列表 List of interceptors in the interceptors chain.
    • 构造器详细资料

      • BeanMethodInterceptorChain

        public BeanMethodInterceptorChain()
    • 方法详细资料

      • add

        protected void add​(BeanMethodInterceptor interceptor)
        像链中添加一个方法拦截器 Add a method interceptor to the chain.
        参数:
        interceptor - 拦截器
      • startInterceptor

        public Object startInterceptor​(Annotation annotation,
                                       Object object,
                                       Method method,
                                       Object[] params,
                                       net.sf.cglib.proxy.MethodProxy methodProxy)
                                throws Throwable
        将一个方法放入该拦截器链中执行,获取返回结果 Puts a method in the interceptor chain to retrieve the returned result.
        参数:
        annotation - 拦截方法的注解实例/Annotation instances of the intercepting method.
        object - 方法所属对象/Method owner
        method - 方法定义/Method definition
        params - 方法参数列表/Method parameter list
        methodProxy - 方法代理器
        返回:
        返回拦截的方法的返回值,可以对该值进行处理和替换/Returns the return value of the intercepting method, which can be processed and replaced.
        抛出:
        Throwable - 该方法可能抛出异常,请谨慎处理/This method may throw an exception, handle with care.