Interface BaseFilter.Listener

All Known Implementing Classes:
ActiveLimitFilter, AdaptiveLoadBalanceFilter, ClassLoaderCallbackFilter, ClassLoaderFilter, CompatibleFilter, ContextFilter, ExceptionFilter, ExecuteLimitFilter, FutureFilter, GenericFilter, GenericImplFilter, ProfilerServerFilter, RpcExceptionFilter, TimeoutFilter
Enclosing interface:
BaseFilter

public static interface BaseFilter.Listener
This 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.

  • Method Summary

    Modifier and Type
    Method
    Description
    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.
  • Method Details

    • 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.
      Parameters:
      appResponse - , the rpc call result, it can represent both normal result and exceptional result
      invoker - , context
      invocation - , 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.
      Parameters:
      t - , framework exception
      invoker - , context
      invocation - , context