/** * Bean init-method. */ @PostConstruct public void initBean() { LOG.info("Init default event service."); listeners = Collections.newSetFromMap(new ConcurrentHashMap<EventServiceListener, Boolean>()); neighbors = new Neighbors<>(KaaThriftService.OPERATIONS_SERVICE, new MessageTemplate(this), operationsServerConfig.getMaxNumberNeighborConnections()); }
/** * Bean init-method. */ @PostConstruct public void initBean() { LOG.info("Init default cluster service."); neighbors = new Neighbors<>(KaaThriftService.OPERATIONS_SERVICE, new MessageTemplate(), operationsServerConfig.getMaxNumberNeighborConnections()); }
/** * Check neighbors. */ private void checkNeighbors() { if (neighbors == null) { synchronized (zkLock) { if (neighbors == null) { neighbors = new Neighbors<>( KaaThriftService.OPERATIONS_SERVICE, new NeighborTemplate<OperationsServiceMsg>() { @Override public void process(Iface client, List<OperationsServiceMsg> messages) throws TException { OperationsServiceMsg.dispatch(client, messages); } @Override public void onServerError(String serverId, Exception ex) { LOG.error("Can't send configuration update to {}", serverId, ex); } }, neighborConnectionsSize); ControlNode zkNode = controlZkService.getControlZkNode(); neighbors.setZkNode( KaaThriftService.KAA_NODE_SERVICE, zkNode.getControlServerInfo().getConnectionInfo(), zkNode); } } } }