@Override public void sendMessage(ILocationSpecifier loc, IMessage message, IRequestSender requestSender) { ConnectionInstance connectionInstance = instancesMapping.get(loc); int xid = XidGenerator.generateXid(); message.setXid(xid); messagesMapping.put(xid, message); connectionInstance.sendRequest(message, requestSender); requestSendersMapping.put(xid, requestSender); }
public Response handleResponse(IMessage message) { IRequestSender iRequestSender = requestSendersMapping.get(message.getXid()); iRequestSender.onSuccess(message); return okResponse(); }