- java.lang.Object
-
- org.redkale.cluster.spi.ClusterAgent
-
- org.redkale.cluster.spi.CacheClusterAgent
-
- 所有已实现的接口:
Resourcable
public class CacheClusterAgent extends ClusterAgent implements Resourcable
使用CacheSource实现的第三方服务发现管理接口cluster详情见: https://redkale.org
- 从以下版本开始:
- 2.3.0
- 作者:
- zhangjx
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
CacheClusterAgent.AddressEntry
-
从类继承的嵌套类/接口 org.redkale.cluster.spi.ClusterAgent
ClusterAgent.ClusterEntry
-
-
字段概要
字段 修饰符和类型 字段 说明 protected ConcurrentHashMap<String,Set<InetSocketAddress>>
httpAddressMap
protected ScheduledThreadPoolExecutor
scheduler
protected ConcurrentHashMap<String,Set<InetSocketAddress>>
sncpAddressMap
protected ScheduledFuture
taskFuture
protected int
ttls
-
从类继承的字段 org.redkale.cluster.spi.ClusterAgent
appAddress, application, appName, config, localEntrys, logger, name, nodeid, ports, protocols, remoteEntrys, tags, waits
-
-
构造器概要
构造器 构造器 说明 CacheClusterAgent()
-
方法概要
-
从类继承的方法 org.redkale.cluster.spi.ClusterAgent
afterDeregister, canRegister, containsPort, containsProtocol, deregister, generateApplicationHost, generateApplicationPort, generateApplicationServiceId, generateApplicationServiceType, generateServiceId, getConfig, getLocalEntrys, getName, getPorts, getProtocols, getRemoteEntrys, intervalCheckSeconds, register, setName, setPorts, setProtocols, updateSncpAddress, urlEncode
-
-
-
-
字段详细资料
-
ttls
protected int ttls
-
scheduler
protected ScheduledThreadPoolExecutor scheduler
-
taskFuture
protected ScheduledFuture taskFuture
-
httpAddressMap
protected final ConcurrentHashMap<String,Set<InetSocketAddress>> httpAddressMap
-
sncpAddressMap
protected final ConcurrentHashMap<String,Set<InetSocketAddress>> sncpAddressMap
-
-
方法详细资料
-
init
public void init(AnyValue config)
- 覆盖:
init
在类中ClusterAgent
-
onResourceChange
@ResourceChanged public void onResourceChange(ResourceEvent[] events)
- 指定者:
onResourceChange
在类中ClusterAgent
-
setConfig
public void setConfig(AnyValue config)
- 覆盖:
setConfig
在类中ClusterAgent
-
destroy
public void destroy(AnyValue config)
- 覆盖:
destroy
在类中ClusterAgent
-
getSourceName
public String getSourceName()
-
resourceName
public String resourceName()
- 指定者:
resourceName
在接口中Resourcable
-
acceptsConf
public boolean acceptsConf(AnyValue config)
从类复制的说明:ClusterAgent
ServiceLoader时判断配置是否符合当前实现类- 指定者:
acceptsConf
在类中ClusterAgent
- 参数:
config
- 节点配置- 返回:
- boolean
-
start
public void start()
- 覆盖:
start
在类中ClusterAgent
-
loadSncpAddressHealth
protected void loadSncpAddressHealth()
-
checkHttpAddressHealth
protected void checkHttpAddressHealth()
-
checkLocalHealth
protected void checkLocalHealth(ClusterAgent.ClusterEntry entry)
-
querySncpAddress
public CompletableFuture<Set<InetSocketAddress>> querySncpAddress(String protocol, String module, String resname)
- 指定者:
querySncpAddress
在类中ClusterAgent
-
queryHttpAddress
public CompletableFuture<Set<InetSocketAddress>> queryHttpAddress(String protocol, String module, String resname)
- 指定者:
queryHttpAddress
在类中ClusterAgent
-
queryAddress
protected CompletableFuture<Set<InetSocketAddress>> queryAddress(ClusterAgent.ClusterEntry entry)
- 指定者:
queryAddress
在类中ClusterAgent
-
isApplicationHealth
protected boolean isApplicationHealth()
-
checkApplicationHealth
protected void checkApplicationHealth()
-
register
public void register(Application application)
- 指定者:
register
在类中ClusterAgent
-
deregister
public void deregister(Application application)
- 指定者:
deregister
在类中ClusterAgent
-
register
protected ClusterAgent.ClusterEntry register(NodeServer ns, String protocol, Service service)
- 指定者:
register
在类中ClusterAgent
-
deregister
protected void deregister(NodeServer ns, String protocol, Service service)
- 指定者:
deregister
在类中ClusterAgent
-
deregister
protected void deregister(NodeServer ns, String protocol, Service service, boolean realCanceled)
-
generateApplicationServiceName
protected String generateApplicationServiceName()
-
generateServiceName
protected String generateServiceName(NodeServer ns, String protocol, Service service)
- 覆盖:
generateServiceName
在类中ClusterAgent
-
generateHttpServiceName
public String generateHttpServiceName(String protocol, String module, String resname)
- 覆盖:
generateHttpServiceName
在类中ClusterAgent
-
generateSncpServiceName
public String generateSncpServiceName(String protocol, String restype, String resname)
- 覆盖:
generateSncpServiceName
在类中ClusterAgent
-
generateApplicationCheckName
protected String generateApplicationCheckName()
-
generateApplicationCheckId
protected String generateApplicationCheckId()
-
generateCheckName
protected String generateCheckName(NodeServer ns, String protocol, Service service)
- 覆盖:
generateCheckName
在类中ClusterAgent
-
generateCheckId
protected String generateCheckId(NodeServer ns, String protocol, Service service)
- 覆盖:
generateCheckId
在类中ClusterAgent
-
-