@ThreadSafe public class FilterInvoker extends Object implements Invoker
过滤器包装的Invoker对象,主要是隔离了filter和service的关系,这样的话filter也可以是单例
| 限定符和类型 | 字段和说明 |
|---|---|
protected AbstractInterfaceConfig |
config
过滤器所在的接口,可能是provider或者consumer
|
protected Map<String,Object> |
configContext
unmodifiable
一些和请求无关的固定的上下文,这些内容从config里加载,和invocation无关 例如是否开启validation配置,方法级是否开启配置。 |
protected FilterInvoker |
invoker
下一层Invoker
|
protected Filter |
nextFilter
下一层过滤器
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
FilterInvoker(AbstractInterfaceConfig config)
如果无需下一层过滤器
|
|
FilterInvoker(Filter nextFilter,
FilterInvoker invoker,
AbstractInterfaceConfig config)
构造函数
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
getBooleanMethodParam(String methodName,
String paramKey,
boolean defaultValue)
取得方法的特殊参数配置
|
AbstractInterfaceConfig |
getConfig()
得到接口配置
|
protected Map<String,Object> |
getConfigContext()
unmodifiable
一些和请求无关的固定的上下文,这些内容从config里加载,和invocation无关 例如是否开启validation配置,方法级是否开启配置。 |
protected int |
getIntMethodParam(String methodName,
String paramKey,
int defaultValue)
取得方法的特殊参数配置
|
protected FilterInvoker |
getInvoker()
得到下一个FilterInvoker
|
protected Object |
getMethodParam(String methodName,
String paramKey)
取得方法的特殊参数配置
|
protected String |
getStringMethodParam(String methodName,
String paramKey,
String defaultValue)
取得方法的特殊参数配置
|
SofaResponse |
invoke(SofaRequest request)
执行调用
|
protected Filter nextFilter
protected FilterInvoker invoker
protected AbstractInterfaceConfig config
protected FilterInvoker(AbstractInterfaceConfig config)
config - 过滤器所在的接口配置public FilterInvoker(Filter nextFilter, FilterInvoker invoker, AbstractInterfaceConfig config)
nextFilter - 下一层过滤器invoker - 下一层调用器config - 过滤器所在的接口配置public SofaResponse invoke(SofaRequest request) throws SofaRpcException
Invokerinvoke 在接口中 Invokerrequest - 请求SofaRpcException - rpc异常protected Map<String,Object> getConfigContext()
public AbstractInterfaceConfig getConfig()
@JustForTest protected FilterInvoker getInvoker()
protected boolean getBooleanMethodParam(String methodName, String paramKey, boolean defaultValue)
methodName - 方法名paramKey - 参数关键字defaultValue - 默认值protected String getStringMethodParam(String methodName, String paramKey, String defaultValue)
methodName - 方法名paramKey - 参数关键字defaultValue - 默认值protected int getIntMethodParam(String methodName, String paramKey, int defaultValue)
methodName - 方法名paramKey - 参数关键字defaultValue - 默认值Copyright © 2008–2018 The Ant Financial. All rights reserved.