public class CompatibleFilter extends Object implements Filter, BaseFilter.Listener
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.
FilterBaseFilter.Listener| 构造器和说明 |
|---|
CompatibleFilter() |
| 限定符和类型 | 方法和说明 |
|---|---|
Result |
invoke(Invoker<?> invoker,
Invocation invocation)
Always call invoker.invoke() in the implementation to hand over the request to the next filter node.
|
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.
|
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException
BaseFilterinvoke 在接口中 BaseFilterRpcExceptionpublic void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation)
BaseFilter.ListeneronResponse 在接口中 BaseFilter.Listenerpublic void onError(Throwable t, Invoker<?> invoker, Invocation invocation)
BaseFilter.ListeneronError 在接口中 BaseFilter.ListenerCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.