private void sendMessagesToServer( NeighborConnection<MessageTemplate, OperationsServiceMsg> server, Collection<OperationsServiceMsg> messages) { try { LOG.trace("Sending to server {} messages: {}", server.getId(), messages); server.sendMessages(messages); } catch (InterruptedException ex) { LOG.error("Error sending events to server: ", ex); } }
/** * Get connections from field <code>neigbors</code> and send messages. * * @param msgs <code>Collection</code> of messages */ public void brodcastMessages(Collection<V> msgs) { if (LOG.isTraceEnabled()) { LOG.trace("Broadcasting {} msgs to {} neighbors", msgs.size(), neigbors.values().size()); } for (NeighborConnection<T, V> neighbor : neigbors.values()) { LOG.trace("Broadcasting to {} neighbor", neighbor); try { neighbor.sendMessages(msgs); } catch (InterruptedException ex) { LOG.warn("Failed to send message to {}", neighbor.getId()); } } }
private void sendMessagesToServer(NeighborConnection<MessageTemplate, Message> server, List<Message> messages) { try { LOG.trace("Sending to server {} messages: {}", server.getId(), messages); server.sendMessages(messages); } catch (InterruptedException ex) { LOG.error("Error sending events to server: ", ex); notifyListenersOnServerProblem(server.getId()); } }
/** * Create connection and send messages. * * @param info is information about connection * @param msgs <code>Collection</code> of messages */ public void sendMessages(ConnectionInfo info, Collection<V> msgs) { NeighborConnection<T, V> neighbor = neigbors.get(getServerId(info)); if (neighbor != null) { try { neighbor.sendMessages(msgs); } catch (InterruptedException ex) { LOG.error("Failed to send message to {}", neighbor.getId()); throw new RuntimeException(ex); } } else { LOG.warn("Can't find server for id {}", getServerId(info)); } }
endpointEvent, routeAddress); server.sendMessages(packMessage(event)); } catch (IOException ex) { LOG.error("Error on converting Event to byte array: skiping this event message", ex);