接口 BaseFilter.Listener
-
- 所有已知实现类:
ActiveLimitFilter,ClassLoaderCallbackFilter,ClassLoaderFilter,CompatibleFilter,ContextFilter,ExceptionFilter,ExecuteLimitFilter,GenericFilter,GenericImplFilter,ProfilerServerFilter,TimeoutFilter
- 封闭接口:
- BaseFilter
public static interface BaseFilter.ListenerThis callback listener applies to both synchronous and asynchronous calls, please put logics that need to be executed on return of rpc result in onResponse or onError respectively based on it is normal return or exception return.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.
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidonError(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.voidonResponse(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.
-
-
-
方法详细资料
-
onResponse
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.- 参数:
appResponse- , the rpc call result, it can represent both normal result and exceptional resultinvoker- , contextinvocation- , context
-
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.- 参数:
t- , framework exceptioninvoker- , contextinvocation- , context
-
-