- java.lang.Object
-
- org.redkale.cluster.spi.ClusterAgent
-
- 直接已知子类:
CacheClusterAgent
public abstract class ClusterAgent extends Object
服务注册中心管理类cluster详情见: https://redkale.org
- 从以下版本开始:
- 2.1.0
- 作者:
- zhangjx
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 class
ClusterAgent.ClusterEntry
-
字段概要
字段 修饰符和类型 字段 说明 protected InetSocketAddress
appAddress
protected Application
application
protected String
appName
protected AnyValue
config
protected ConcurrentHashMap<String,ClusterAgent.ClusterEntry>
localEntrys
protected Logger
logger
protected String
name
protected String
nodeid
protected int[]
ports
protected String[]
protocols
protected ConcurrentHashMap<String,ClusterAgent.ClusterEntry>
remoteEntrys
protected Set<String>
tags
protected boolean
waits
-
构造器概要
构造器 构造器 说明 ClusterAgent()
-
方法概要
-
-
-
字段详细资料
-
logger
protected final Logger logger
-
nodeid
protected String nodeid
-
appName
protected String appName
-
appAddress
protected InetSocketAddress appAddress
-
application
protected Application application
-
name
protected String name
-
waits
protected boolean waits
-
ports
protected int[] ports
-
config
protected AnyValue config
-
localEntrys
protected final ConcurrentHashMap<String,ClusterAgent.ClusterEntry> localEntrys
-
remoteEntrys
protected final ConcurrentHashMap<String,ClusterAgent.ClusterEntry> remoteEntrys
-
-
方法详细资料
-
init
public void init(AnyValue config)
-
onResourceChange
@ResourceChanged public abstract void onResourceChange(ResourceEvent[] events)
-
destroy
public void destroy(AnyValue config)
-
acceptsConf
public abstract boolean acceptsConf(AnyValue config)
ServiceLoader时判断配置是否符合当前实现类- 参数:
config
- 节点配置- 返回:
- boolean
-
containsProtocol
public boolean containsProtocol(String protocol)
-
containsPort
public boolean containsPort(int port)
-
start
public void start()
-
intervalCheckSeconds
public int intervalCheckSeconds()
-
register
public abstract void register(Application application)
-
deregister
public abstract void deregister(Application application)
-
register
public void register(NodeServer ns, String protocol, Set<Service> localServices, Set<Service> remoteServices, Set<Service> servletServices)
-
deregister
public void deregister(NodeServer ns, String protocol, Set<Service> localServices, Set<Service> remoteServices, Set<Service> servletServices)
-
canRegister
protected boolean canRegister(NodeServer ns, String protocol, Service service)
-
afterDeregister
protected void afterDeregister(NodeServer ns, String protocol)
-
queryHttpAddress
public abstract CompletableFuture<Set<InetSocketAddress>> queryHttpAddress(String protocol, String module, String resname)
-
querySncpAddress
public abstract CompletableFuture<Set<InetSocketAddress>> querySncpAddress(String protocol, String resType, String resname)
-
queryAddress
protected abstract CompletableFuture<Set<InetSocketAddress>> queryAddress(ClusterAgent.ClusterEntry entry)
-
register
protected abstract ClusterAgent.ClusterEntry register(NodeServer ns, String protocol, Service service)
-
deregister
protected abstract void deregister(NodeServer ns, String protocol, Service service)
-
updateSncpAddress
protected void updateSncpAddress(ClusterAgent.ClusterEntry entry)
-
generateApplicationServiceName
protected String generateApplicationServiceName()
-
generateApplicationServiceType
protected String generateApplicationServiceType()
-
generateApplicationServiceId
protected String generateApplicationServiceId()
-
generateApplicationCheckName
protected String generateApplicationCheckName()
-
generateApplicationCheckId
protected String generateApplicationCheckId()
-
generateApplicationHost
protected String generateApplicationHost()
-
generateApplicationPort
protected int generateApplicationPort()
-
generateSncpServiceName
public String generateSncpServiceName(String protocol, String resType, String resname)
-
generateHttpServiceName
public String generateHttpServiceName(String protocol, String module, String resname)
-
generateServiceName
protected String generateServiceName(NodeServer ns, String protocol, Service service)
-
generateServiceId
protected String generateServiceId(NodeServer ns, String protocol, Service service)
-
generateCheckName
protected String generateCheckName(NodeServer ns, String protocol, Service service)
-
generateCheckId
protected String generateCheckId(NodeServer ns, String protocol, Service service)
-
getLocalEntrys
protected ConcurrentHashMap<String,ClusterAgent.ClusterEntry> getLocalEntrys()
-
getRemoteEntrys
protected ConcurrentHashMap<String,ClusterAgent.ClusterEntry> getRemoteEntrys()
-
getName
public String getName()
-
setName
public void setName(String name)
-
setProtocols
public void setProtocols(String[] protocols)
-
getPorts
public int[] getPorts()
-
setPorts
public void setPorts(int[] ports)
-
getConfig
public AnyValue getConfig()
-
setConfig
public void setConfig(AnyValue config)
-
-