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);
}
Aggregations