Exemplo n.º 1
0
 public void setServerStatus(long serverStatus) {
   String key =
       ApplicaRuntime.globalFlag
           + itemId
           + "-"
           + bindAddress
           + "-ServerStatus-"
           + ApplicaRuntime.globalFlag;
   RedisUtil.setLong(key, serverStatus);
 }
Exemplo n.º 2
0
  public long getServerStatus() {
    String key =
        ApplicaRuntime.globalFlag
            + itemId
            + "-"
            + bindAddress
            + "-ServerStatus-"
            + ApplicaRuntime.globalFlag;
    Long serverStatus = RedisUtil.getLong(key);

    logger.info("key:" + key + ", serverStatus:" + serverStatus);

    if (serverStatus == null) return ServerStatus.UNKNOWN;
    else return serverStatus;
  }