public class InterceptorChain extends Object
限定符和类型 | 字段和说明 |
---|---|
protected Object[] |
args |
protected Method |
callingMethod |
protected AopCallback |
callingObj |
protected int |
methodIndex |
protected List<MethodInterceptor> |
miList |
protected Object |
returnValue |
构造器和说明 |
---|
InterceptorChain(int methodIndex,
Object obj,
Method method,
List<MethodInterceptor> miList,
Object[] args) |
限定符和类型 | 方法和说明 |
---|---|
InterceptorChain |
doChain()
继续执行下一个拦截器,如果已经没有剩下的拦截器,则执行原方法
|
Object[] |
getArgs()
方法调用的参数数组,如果你要改变参数,那么必须保证参数类型与方法参数兼容.
|
Method |
getCallingMethod()
正在被调用的Method
|
AopCallback |
getCallingObj() |
List<MethodInterceptor> |
getMethodInterceptors()
获取当前的方法拦截器列表,注意,这个列表是不可修改的.如果需要修改,那么请通过
setMethodInterceptors(List) |
Object |
getReturn()
获取返回值
|
void |
invoke()
执行原方法,一般情况下不应该直接被调用
|
boolean |
isInvoked() |
void |
setMethodInterceptors(List<MethodInterceptor> miList)
设置当前调用的方法拦截器列表,注意,这个set只对当前方法调用有效.
|
void |
setReturnValue(Object returnValue) |
protected Method callingMethod
protected int methodIndex
protected Object[] args
protected AopCallback callingObj
protected Object returnValue
protected List<MethodInterceptor> miList
public InterceptorChain(int methodIndex, Object obj, Method method, List<MethodInterceptor> miList, Object[] args)
public InterceptorChain doChain() throws Throwable
Throwable
- 下层拦截器或原方法抛出的一切异常public Object getReturn()
public Method getCallingMethod()
public Object[] getArgs()
public void setReturnValue(Object returnValue)
public AopCallback getCallingObj()
public boolean isInvoked()
public List<MethodInterceptor> getMethodInterceptors()
setMethodInterceptors(List)
public void setMethodInterceptors(List<MethodInterceptor> miList)
Copyright © 2017. All rights reserved.