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| Constructor and Description |
|---|
CompatibleFilter() |
| Modifier and Type | Method and Description |
|---|---|
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 in interface BaseFilterRpcExceptionpublic void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation)
BaseFilter.ListeneronResponse in interface BaseFilter.Listenerpublic void onError(Throwable t, Invoker<?> invoker, Invocation invocation)
BaseFilter.ListeneronError in interface BaseFilter.ListenerCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.