public class InterceptorChain
extends java.lang.Object
This class follows the Spring MVC pattern of tracking the index of the last successfully invoked interceptor, ensuring proper cleanup even when exceptions occur.
| 构造器和说明 |
|---|
InterceptorChain(java.util.List<AcpInterceptor> interceptors)
Create an interceptor chain with the given interceptors.
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.Object |
applyOnError(AcpInvocationContext context,
java.lang.Throwable ex)
Apply onError in reverse order until one handles it.
|
java.lang.Object |
applyPostInvoke(AcpInvocationContext context,
java.lang.Object result)
Apply postInvoke in reverse order.
|
boolean |
applyPreInvoke(AcpInvocationContext context)
Apply preInvoke to all interceptors.
|
void |
triggerAfterCompletion(AcpInvocationContext context,
java.lang.Throwable ex)
Trigger afterCompletion for all started interceptors.
|
public InterceptorChain(java.util.List<AcpInterceptor> interceptors)
interceptors - the interceptorspublic boolean applyPreInvoke(AcpInvocationContext context)
context - the invocation contextpublic java.lang.Object applyPostInvoke(AcpInvocationContext context, java.lang.Object result)
context - the invocation contextresult - the handler resultpublic java.lang.Object applyOnError(AcpInvocationContext context, java.lang.Throwable ex)
context - the invocation contextex - the exceptionpublic void triggerAfterCompletion(AcpInvocationContext context, java.lang.Throwable ex)
context - the invocation contextex - the exception (may be null)