T - the interfaceS - the sub class of AbstractInterfaceConfigpublic abstract class AbstractInterfaceConfig<T,S extends AbstractInterfaceConfig> extends AbstractIdConfig<S> implements Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
protected ApplicationConfig |
application
应用信息
|
protected boolean |
cache
是否启动结果缓存
|
protected Cache |
cacheRef
结果缓存实现类
|
protected String |
compress
压缩算法,为空则不压缩
|
protected ConfigListener |
configListener
服务配置的listener
|
protected Map<String,Object> |
configValueCache
方法名称和方法参数配置的map,不需要遍历list
|
protected List<String> |
filter
过滤器配置别名,多个用逗号隔开
|
protected List<Filter> |
filterRef
过滤器配置实例
|
protected String |
group
已过时。
不再作为服务唯一标识,请直接使用
uniqueId 代替 |
protected String |
interfaceId
服务接口:做为服务唯一标识的组成部分
不管普通调用和泛化调用,都是设置实际的接口类名称, |
protected Map<String,MethodConfig> |
methods
方法配置,可配置多个
|
protected boolean |
mock
是否开启mock
|
protected T |
mockRef
Mock实现类
|
protected Map<String,String> |
parameters
自定义参数
|
protected String |
proxy
代理类型
|
protected Class |
proxyClass
代理接口类,和T对应,主要针对泛化调用
|
protected boolean |
register
是否注册,如果是false只订阅不注册
|
protected List<RegistryConfig> |
registry
注册中心配置,可配置多个
|
protected String |
serialization
默认序列化
|
protected boolean |
subscribe
是否订阅服务
|
protected String |
uniqueId
服务标签:做为服务唯一标识的组成部分
|
protected boolean |
validation
是否开启参数验证(jsr303)
|
protected String |
version
已过时。
从5.4.0开始,不再作为服务唯一标识,请直接使用
uniqueId 代替 |
| 构造器和说明 |
|---|
AbstractInterfaceConfig() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract String |
buildKey()
构造关键字方法
|
ApplicationConfig |
getApplication()
Gets application.
|
String |
getAppName()
Gets app name.
|
Cache |
getCacheRef()
Gets cache ref.
|
String |
getCompress()
Gets compress.
|
ConfigListener |
getConfigListener()
得到配置监听器
|
Map<String,Object> |
getConfigValueCache()
Gets config value cache.
|
Map<String,Object> |
getConfigValueCache(boolean rebuild)
接口属性和方法属性加载配置到缓存
|
List<String> |
getFilter()
Gets filters.
|
List<Filter> |
getFilterRef()
Gets filter ref.
|
String |
getGroup()
已过时。
|
String |
getInterfaceId()
Gets interface id.
|
Object |
getMethodConfigValue(String methodName,
String configKey)
得到方法级配置,找不到则返回null
|
Object |
getMethodConfigValue(String methodName,
String configKey,
Object defaultValue)
得到方法级配置,找不到则返回默认值
|
Map<String,MethodConfig> |
getMethods()
Gets methods.
|
T |
getMockRef()
Gets mock ref.
|
String |
getParameter(String key)
Gets parameter.
|
Map<String,String> |
getParameters()
Gets parameters.
|
String |
getProxy()
Gets proxy.
|
protected abstract Class<?> |
getProxyClass()
Gets proxy class.
|
List<RegistryConfig> |
getRegistry()
Gets registry.
|
String |
getSerialization()
Gets serialization.
|
String |
getUniqueId()
Gets uniqueId.
|
String |
getVersion()
已过时。
|
boolean |
hasCache()
是否有缓存
|
abstract boolean |
hasConcurrents()
是否有并发限制配置
|
abstract boolean |
hasTimeout()
是否有超时配置
|
boolean |
hasToken()
是否有token配置
|
boolean |
hasValidation()
除了判断自己,还有判断下面方法的自定义判断
|
boolean |
isCache()
Is cache boolean.
|
boolean |
isMock()
Is mock boolean.
|
boolean |
isRegister()
Is register boolean.
|
boolean |
isSubscribe()
Is subscribe boolean.
|
boolean |
isValidation()
Is validation boolean.
|
String |
queryAttribute(String property)
查询属性值
|
S |
setApplication(ApplicationConfig application)
Sets application.
|
S |
setCache(boolean cache)
Sets cache.
|
S |
setCacheRef(Cache cacheRef)
Sets cache ref.
|
S |
setCompress(String compress)
Sets compress.
|
S |
setConfigListener(ConfigListener configListener)
Sets config listener.
|
S |
setFilter(List<String> filter)
Sets filter.
|
S |
setFilterRef(List<Filter> filterRef)
Sets filter ref.
|
S |
setGroup(String group)
已过时。
|
S |
setInterfaceId(String interfaceId)
Sets interface id.
|
S |
setMethods(List<MethodConfig> methods)
Sets methods.
|
S |
setMethods(Map<String,MethodConfig> methods)
Sets methods.
|
S |
setMock(boolean mock)
Sets mock.
|
S |
setMockRef(T mockRef)
Sets mock ref.
|
S |
setParameter(String key,
String value)
Sets parameter.
|
S |
setParameters(Map<String,String> parameters)
Sets parameters.
|
S |
setProxy(String proxy)
Sets proxy.
|
S |
setRegister(boolean register)
Sets register.
|
S |
setRegistry(List<RegistryConfig> registry)
Sets registry.
|
S |
setRegistry(RegistryConfig registry)
设置注册中心
|
S |
setSerialization(String serialization)
Sets serialization.
|
S |
setSubscribe(boolean subscribe)
Sets subscribe.
|
S |
setUniqueId(String uniqueId)
Sets uniqueId.
|
S |
setValidation(boolean validation)
Sets validation.
|
S |
setVersion(String version)
已过时。
|
boolean |
updateAttribute(String property,
String newValueStr,
boolean overwrite)
覆盖属性,可以检查,或者更新
|
castThis, getId, setIdprotected ApplicationConfig application
protected String uniqueId
interfaceIdprotected List<RegistryConfig> registry
protected Map<String,MethodConfig> methods
protected String serialization
protected boolean register
protected boolean subscribe
protected String proxy
@Deprecated protected String group
uniqueId 代替protected String version
uniqueId 代替interfaceId,
uniqueIdprotected transient Cache cacheRef
protected transient T mockRef
protected boolean cache
protected boolean mock
protected boolean validation
protected String compress
protected transient volatile Map<String,Object> configValueCache
protected transient volatile Class proxyClass
protected transient volatile ConfigListener configListener
protected abstract Class<?> getProxyClass()
protected abstract String buildKey()
public ApplicationConfig getApplication()
public S setApplication(ApplicationConfig application)
application - the applicationpublic String getInterfaceId()
public S setInterfaceId(String interfaceId)
interfaceId - the interface idpublic String getUniqueId()
public S setUniqueId(String uniqueId)
uniqueId - the uniqueIdpublic S setFilterRef(List<Filter> filterRef)
filterRef - the filter refpublic List<RegistryConfig> getRegistry()
public S setRegistry(List<RegistryConfig> registry)
registry - the registrypublic Map<String,MethodConfig> getMethods()
public S setMethods(Map<String,MethodConfig> methods)
methods - the methodspublic String getSerialization()
public S setSerialization(String serialization)
serialization - the serializationpublic boolean isRegister()
public S setRegister(boolean register)
register - the registerpublic boolean isSubscribe()
public S setSubscribe(boolean subscribe)
subscribe - the subscribepublic String getProxy()
@Deprecated public String getGroup()
@Deprecated public S setGroup(String group)
setUniqueId(String)group - the group@Deprecated public String getVersion()
@Deprecated public S setVersion(String version)
setUniqueId(String)version - the versionpublic Cache getCacheRef()
public S setCacheRef(Cache cacheRef)
cacheRef - the cache refpublic T getMockRef()
public S setParameters(Map<String,String> parameters)
parameters - the parameterspublic boolean isMock()
public S setMock(boolean mock)
mock - the mockpublic boolean isValidation()
public S setValidation(boolean validation)
validation - the validationpublic String getCompress()
public S setCompress(String compress)
compress - the compresspublic boolean isCache()
public S setCache(boolean cache)
cache - the cachepublic Map<String,Object> getConfigValueCache()
public S setConfigListener(ConfigListener configListener)
configListener - the config listenerpublic ConfigListener getConfigListener()
public abstract boolean hasTimeout()
public abstract boolean hasConcurrents()
public boolean hasValidation()
public boolean hasCache()
public boolean hasToken()
public S setMethods(List<MethodConfig> methods)
methods - the methodspublic S setRegistry(RegistryConfig registry)
registry - RegistryConfigpublic Map<String,Object> getConfigValueCache(boolean rebuild)
rebuild - 是否重建public boolean updateAttribute(String property, String newValueStr, boolean overwrite)
property - 属性newValueStr - 要设置的值overwrite - 是否覆盖 true直接覆盖,false为检查public Object getMethodConfigValue(String methodName, String configKey, Object defaultValue)
methodName - 方法名configKey - 配置key,例如参数defaultValue - 默认值public Object getMethodConfigValue(String methodName, String configKey)
methodName - 方法名configKey - 配置key,例如参数public S setParameter(String key, String value)
key - the keyvalue - the valuepublic String getAppName()
Copyright © 2008–2018 The Ant Financial. All rights reserved.