Search in sources :

Example 1 with NodeSessionExpired

use of com.alibaba.otter.shared.arbitrate.impl.manage.NodeSessionExpired in project otter by alibaba.

the class OtterController method initNid.

private void initNid() {
    // 获取一下nid变量
    String nid = System.getProperty(OtterConstants.NID_NAME);
    if (StringUtils.isEmpty(nid)) {
        throw new ConfigException("nid is not set!");
    }
    logger.info("INFO ## the nodeId = {}", nid);
    checkNidVaild(nid);
    arbitrateManageService.nodeEvent().init(Long.valueOf(nid));
    // 添加session expired处理
    NodeSessionExpired sessionExpired = new NodeSessionExpired();
    sessionExpired.setNodeEvent(arbitrateManageService.nodeEvent());
    ZooKeeperClient.registerNotification(sessionExpired);
}
Also used : NodeSessionExpired(com.alibaba.otter.shared.arbitrate.impl.manage.NodeSessionExpired) ConfigException(com.alibaba.otter.shared.common.model.config.ConfigException)

Aggregations

NodeSessionExpired (com.alibaba.otter.shared.arbitrate.impl.manage.NodeSessionExpired)1 ConfigException (com.alibaba.otter.shared.common.model.config.ConfigException)1