public class ServerMonitorDaemon extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_INTERVAL |
| 构造器和说明 |
|---|
ServerMonitorDaemon() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addInvalidServer(Server server,
Cluster cluster)
添加一个要进行监视的无效服务器
|
static List<Server> |
getCurrentMonitoringServers() |
static int |
getInterval() |
static boolean |
isServerAvailable(Server server)
检查服务器是否可以连接
|
static void |
setInterval(int interval)
设置检查时间间隔。
|
public static final int DEFAULT_INTERVAL
public static int getInterval()
public static void setInterval(int interval)
DEFAULT_INTERVALinterval - 检查时间间隔(ms)public static void addInvalidServer(Server server, Cluster cluster)
server - 无法连接的服务器cluster - server 所属的 Cluster 对象。
1. 当 server 恢复运作时,将调用 cluster 的 Cluster.markValid(Server) 方法;
2. 当 server 被从 cluster 中移除时,不再进行监视。Copyright © 2019. All rights reserved.