@Override public void run() { final Message msg = this.msg; this.msg = null; handler.handleMessage(msg); } }
@Override public void handleMessage(Message msg) { msgHandler.handleMessage(msg); }
@Override public void handleMessage(Message msg) { msgHandler.handleMessage(msg); }
@Override public void handleMessage(Message msg) { MessageHandler msgHandler = this.msgHandler.get(); if (msgHandler == null) { Reply reply = new EmptyReply(); reply.swapState(msg); reply.addError(new Error(ErrorCode.SESSION_BUSY, "Session not fully configured yet.")); sendReply(reply); return; } msgHandler.handleMessage(msg); }
@Override public void handleMessage(Message msg) { MessageHandler msgHandler = this.msgHandler.get(); if (msgHandler == null) { Reply reply = new EmptyReply(); reply.swapState(msg); reply.addError(new Error(ErrorCode.SESSION_BUSY, "Session not fully configured yet.")); sendReply(reply); return; } msgHandler.handleMessage(msg); }
/** * All messages pass through this handler when being sent by the owning source session. In case the message has no * sequencing-id, it is simply passed through to the next handler in the chain. Sequenced messages are sent only if * there is no queue for their id, otherwise they are queued. * * @param msg the message to send. */ @Override public void handleMessage(Message msg) { if (destroyed.get()) { msg.discard(); return; } if (msg.hasSequenceId()) { if (filter(msg)) { sequencedSend(msg); } } else { sender.handleMessage(msg); // unsequenced } }
/** * Internal method for forwarding a sequenced message to the underlying sender. * * @param msg The message to forward. */ private void sequencedSend(Message msg) { if (msg.getTrace().shouldTrace(TraceLevel.COMPONENT)) { msg.getTrace().trace(TraceLevel.COMPONENT, "Sequencer sending message with sequence id '" + msg.getContext() + "'."); } msg.pushHandler(this); sender.handleMessage(msg); }