类 CompatibleFilter

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

    public class CompatibleFilter
    extends Object
    implements Filter, BaseFilter.Listener
    CompatibleFilter make the remote method's return value compatible to invoker's version of object. To make return object compatible it does
        1)If the url contain serialization key of type json or fastjson then transform
        the return value to instance of Map
        2)If the return value is not a instance of invoked method's return type available at
        local jvm then POJO conversion.
        3)If return value is other than above return value as it is.
     
    另请参阅:
    Filter
    • 构造器详细资料

      • CompatibleFilter

        public CompatibleFilter()
    • 方法详细资料

      • 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 t,
                            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
        参数:
        t - , framework exception
        invoker - , context
        invocation - , context