public synchronized void bindConnectionNode(OteServerJmsNodeProvider connectionNode) { this.connecitonNode = connectionNode; connecitonNode.getConnectionNode().subscribe(BridgeMessages.BYTE_MESSAGE, this); for (Event event : eventQueue) { sendEvent(event); } eventQueue.clear(); }
private void sendEvent(Event event) { OteEventMessage message = OteEventMessageUtil.getOteEventMessage(event); if (message != null) { try { UUID id = OteEventMessageUtil.getUUID(message); if (!id.equals(MYID)) { OteEventMessageUtil.setUUID(message, MYID); connecitonNode.getConnectionNode().send(BridgeMessages.BYTE_MESSAGE, message.getData()); } } catch (OseeCoreException e) { e.printStackTrace(); } } }
public synchronized void unbindConnectionNode(OteServerJmsNodeProvider connectionNode) { connecitonNode.getConnectionNode().unsubscribe(BridgeMessages.BYTE_MESSAGE, this); this.connecitonNode = null; }