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