T - the type parameterpublic class ProviderConfig<T> extends AbstractInterfaceConfig<T,ProviderConfig<T>> implements Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
bootstrap
启动器
|
protected int |
concurrents
接口下每方法的最大可并行执行请求数,配置-1关闭并发过滤器,等于0表示开启过滤但是不限制
|
protected int |
delay
服务发布延迟,单位毫秒,默认0,配置为-1代表spring加载完毕(通过spring才生效)
|
protected boolean |
dynamic
是否动态注册,默认为true,配置为false代表不主动发布,需要到管理端进行上线操作
|
protected String |
exclude
不发布的方法列表,逗号分隔
|
protected ThreadPoolExecutor |
executor
自定义线程池
|
protected String |
include
包含的方法
|
protected ConcurrentHashMap<String,Boolean> |
methodsLimit
方法名称:是否可调用
|
protected int |
priority
服务优先级,越大越高
|
protected ProviderBootstrap |
providerBootstrap
服务提供者启动类
|
protected T |
ref
接口实现类引用
|
protected int |
repeatedExportLimit
同一个服务(接口协议uniqueId相同)的最大发布次数,防止由于代码bug导致重复发布。
|
protected List<ServerConfig> |
server
配置的协议列表
|
protected int |
timeout
服务端执行超时时间(毫秒),不会打断执行线程,只是打印警告
|
protected int |
weight
权重
|
application, cache, cacheRef, compress, configListener, configValueCache, filter, filterRef, group, interfaceId, methods, mock, mockRef, parameters, proxy, proxyClass, register, registry, serialization, subscribe, uniqueId, validation, version| 构造器和说明 |
|---|
ProviderConfig() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
buildKey()
Build key.
|
void |
export()
发布服务
|
String |
getBootstrap()
Gets bootstrap.
|
int |
getConcurrents()
Gets concurrents.
|
int |
getDelay()
Gets delay.
|
String |
getExclude()
Gets exclude.
|
ThreadPoolExecutor |
getExecutor()
Gets executor.
|
String |
getInclude()
Gets include.
|
Map<String,Boolean> |
getMethodsLimit()
得到可调用的方法名称列表
|
int |
getPriority()
Gets priority.
|
ProviderBootstrap |
getProviderBootstrap()
得到服务提供者启动器
|
Class<?> |
getProxyClass()
Gets proxy class.
|
T |
getRef()
Gets ref.
|
int |
getRepeatedExportLimit()
Gets repeated export limit.
|
List<ServerConfig> |
getServer()
Gets server.
|
int |
getTimeout()
Gets client timeout.
|
int |
getWeight()
Gets weight.
|
boolean |
hasConcurrents()
是否有并发控制需求,有就打开过滤器
配置-1关闭并发过滤器,等于0表示开启过滤但是不限制
|
boolean |
hasTimeout()
是否有超时配置
|
boolean |
isDynamic()
Is dynamic boolean.
|
ProviderConfig<T> |
setBootstrap(String bootstrap)
Sets bootstrap.
|
ProviderConfig<T> |
setConcurrents(int concurrents)
Sets concurrents.
|
ProviderConfig<T> |
setDelay(int delay)
Sets delay.
|
ProviderConfig<T> |
setDynamic(boolean dynamic)
Sets dynamic.
|
ProviderConfig<T> |
setExclude(String exclude)
Sets exclude.
|
ProviderConfig<T> |
setExecutor(ThreadPoolExecutor executor)
Sets executor.
|
ProviderConfig<T> |
setInclude(String include)
Sets include.
|
ProviderConfig<T> |
setMethodsLimit(ConcurrentHashMap<String,Boolean> methodsLimit)
Sets methodsLimit.
|
ProviderConfig<T> |
setPriority(int priority)
Sets priority.
|
ProviderConfig<T> |
setRef(T ref)
Sets ref.
|
ProviderConfig<T> |
setRepeatedExportLimit(int repeatedExportLimit)
Sets repeated export limit.
|
ProviderConfig<T> |
setServer(List<ServerConfig> server)
Sets server.
|
ProviderConfig<T> |
setServer(ServerConfig server)
add server.
|
ProviderConfig |
setTimeout(int timeout)
Sets client timeout.
|
ProviderConfig<T> |
setWeight(int weight)
Sets weight.
|
void |
unExport()
取消发布服务
|
getApplication, getAppName, getCacheRef, getCompress, getConfigListener, getConfigValueCache, getConfigValueCache, getFilter, getFilterRef, getGroup, getInterfaceId, getMethodConfigValue, getMethodConfigValue, getMethods, getMockRef, getParameter, getParameters, getProxy, getRegistry, getSerialization, getUniqueId, getVersion, hasCache, hasToken, hasValidation, isCache, isMock, isRegister, isSubscribe, isValidation, queryAttribute, setApplication, setCache, setCacheRef, setCompress, setConfigListener, setFilter, setFilterRef, setGroup, setInterfaceId, setMethods, setMethods, setMock, setMockRef, setParameter, setParameters, setProxy, setRegister, setRegistry, setRegistry, setSerialization, setSubscribe, setUniqueId, setValidation, setVersion, updateAttributecastThis, getId, setIdprotected transient T ref
protected List<ServerConfig> server
protected int delay
protected int weight
protected String include
protected String exclude
protected boolean dynamic
protected int priority
protected String bootstrap
protected transient ThreadPoolExecutor executor
protected int timeout
protected int concurrents
protected int repeatedExportLimit
protected transient volatile ConcurrentHashMap<String,Boolean> methodsLimit
protected transient ProviderBootstrap providerBootstrap
public Class<?> getProxyClass()
getProxyClass 在类中 AbstractInterfaceConfig<T,ProviderConfig<T>>public String buildKey()
buildKey 在类中 AbstractInterfaceConfig<T,ProviderConfig<T>>public T getRef()
public ProviderConfig<T> setRef(T ref)
ref - the refpublic List<ServerConfig> getServer()
public ProviderConfig<T> setServer(List<ServerConfig> server)
server - the serverpublic int getDelay()
public ProviderConfig<T> setDelay(int delay)
delay - the delaypublic int getWeight()
public ProviderConfig<T> setWeight(int weight)
weight - the weightpublic String getInclude()
public ProviderConfig<T> setInclude(String include)
include - the includepublic String getExclude()
public ProviderConfig<T> setExclude(String exclude)
exclude - the excludepublic boolean isDynamic()
public ProviderConfig<T> setDynamic(boolean dynamic)
dynamic - the dynamicpublic int getPriority()
public ProviderConfig<T> setPriority(int priority)
priority - the prioritypublic String getBootstrap()
public ProviderConfig<T> setBootstrap(String bootstrap)
bootstrap - the bootstrappublic ThreadPoolExecutor getExecutor()
public ProviderConfig<T> setExecutor(ThreadPoolExecutor executor)
executor - the executorpublic int getConcurrents()
public ProviderConfig<T> setConcurrents(int concurrents)
concurrents - the concurrentspublic int getRepeatedExportLimit()
public ProviderConfig<T> setRepeatedExportLimit(int repeatedExportLimit)
repeatedExportLimit - the repeated export limitpublic int getTimeout()
public ProviderConfig setTimeout(int timeout)
timeout - the client timeoutpublic boolean hasTimeout()
AbstractInterfaceConfighasTimeout 在类中 AbstractInterfaceConfig<T,ProviderConfig<T>>public boolean hasConcurrents()
hasConcurrents 在类中 AbstractInterfaceConfig<T,ProviderConfig<T>>public ProviderConfig<T> setServer(ServerConfig server)
server - ServerConfigpublic Map<String,Boolean> getMethodsLimit()
public ProviderConfig<T> setMethodsLimit(ConcurrentHashMap<String,Boolean> methodsLimit)
methodsLimit - the methodsLimitpublic void export()
public void unExport()
public ProviderBootstrap getProviderBootstrap()
Copyright © 2008–2018 The Ant Financial. All rights reserved.