public static interface BaseFilter.Listener
There's something that needs to pay attention on legacy synchronous style filer refactor, the thing is, try to move logics previously defined in the 'finally block' to both onResponse and onError.
| 限定符和类型 | 方法和说明 |
|---|---|
void |
onError(Throwable t,
Invoker<?> invoker,
Invocation invocation)
This method will be called on detection of framework exceptions, for example, TimeoutException, NetworkException
Exception raised in Filters, etc.
|
void |
onResponse(Result appResponse,
Invoker<?> invoker,
Invocation invocation)
This method will only be called on successful remote rpc execution, that means, the service in on remote received
the request and the result (normal or exceptional) returned successfully.
|
void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation)
appResponse, - the rpc call result, it can represent both normal result and exceptional resultinvoker, - contextinvocation, - contextvoid onError(Throwable t, Invoker<?> invoker, Invocation invocation)
t, - framework exceptioninvoker, - contextinvocation, - contextCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.