类 BeanMethodInterceptorManager


  • public class BeanMethodInterceptorManager
    extends Object
    拦截器管理器 Interceptor manager.
    作者:
    Eva Wang
    • 构造器详细资料

      • BeanMethodInterceptorManager

        public BeanMethodInterceptorManager()
    • 方法详细资料

      • addBeanMethodInterceptor

        public static void addBeanMethodInterceptor​(Class annotationType,
                                                    BeanMethodInterceptor interceptor)
        添加方法拦截器到管理器中 Add a method interceptor to the manager.
        参数:
        annotationType - 注解类型
        interceptor - 拦截器
      • doInterceptor

        public static Object doInterceptor​(Annotation[] annotations,
                                           Object object,
                                           Method method,
                                           Object[] params,
                                           net.sf.cglib.proxy.MethodProxy methodProxy)
                                    throws Throwable
        执行一个方法,根据方法的注解组装拦截器链,并放入拦截器链中执行 Implement a method that assembles the interceptor chain according to the method's annotations and puts it into the interceptor chain.
        参数:
        annotations - 方法上标注的注解列表/Method annotated list of annotations.
        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.