类 ExceptionFilter

  • 所有已实现的接口:
    BaseFilter, BaseFilter.Listener, Filter

    @Activate(group="provider")
    public class ExceptionFilter
    extends Object
    implements Filter, BaseFilter.Listener
    ExceptionInvokerFilter

    Functions:

    1. unexpected exception will be logged in ERROR level on provider side. Unexpected exception are unchecked exception not declared on the interface
    2. Wrap the exception not introduced in API package into RuntimeException. Framework will serialize the outer exception but stringnize its cause in order to avoid of possible serialization problem on client side
    • 构造器详细资料

      • ExceptionFilter

        public ExceptionFilter()
    • 方法详细资料

      • onResponse

        public void onResponse​(Result appResponse,
                               Invoker<?> invoker,
                               Invocation invocation)
        从接口复制的说明: BaseFilter.Listener
        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 在接口中 BaseFilter.Listener
        参数:
        appResponse - , the rpc call result, it can represent both normal result and exceptional result
        invoker - , context
        invocation - , context
      • onError

        public void onError​(Throwable e,
                            Invoker<?> invoker,
                            Invocation invocation)
        从接口复制的说明: BaseFilter.Listener
        This method will be called on detection of framework exceptions, for example, TimeoutException, NetworkException Exception raised in Filters, etc.
        指定者:
        onError 在接口中 BaseFilter.Listener
        参数:
        e - , framework exception
        invoker - , context
        invocation - , context
      • setLogger

        public void setLogger​(Logger logger)