类 BeanMethodInterceptorChain
- java.lang.Object
-
- network.nerve.core.core.inteceptor.base.BeanMethodInterceptorChain
-
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
-
-
字段概要
字段 修饰符和类型 字段 说明 protected List<BeanMethodInterceptor>interceptorList链中的拦截器列表 List of interceptors in the interceptors chain.
-
构造器概要
构造器 构造器 说明 BeanMethodInterceptorChain()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected voidadd(BeanMethodInterceptor interceptor)像链中添加一个方法拦截器 Add a method interceptor to the chain.Objectexecute(Annotation annotation, Object object, Method method, Object[] params)调用一个具体的拦截器 Call a specific interceptor.ObjectstartInterceptor(Annotation annotation, Object object, Method method, Object[] params, net.sf.cglib.proxy.MethodProxy methodProxy)将一个方法放入该拦截器链中执行,获取返回结果 Puts a method in the interceptor chain to retrieve the returned result.
-
-
-
字段详细资料
-
interceptorList
protected List<BeanMethodInterceptor> interceptorList
链中的拦截器列表 List of interceptors in the interceptors chain.
-
-
方法详细资料
-
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 ownermethod- 方法定义/Method definitionparams- 方法参数列表/Method parameter listmethodProxy- 方法代理器- 返回:
- 返回拦截的方法的返回值,可以对该值进行处理和替换/Returns the return value of the intercepting method, which can be processed and replaced.
- 抛出:
Throwable- 该方法可能抛出异常,请谨慎处理/This method may throw an exception, handle with care.
-
-