/** * Pops a header from a message. Creates a new Header from the values contained by the message. * * @param message message that contains the info to build the header * @return a header builted from the values of contained by the message */ public static DATAHeader pop(Message message) { DATAHeader header = new DATAHeader(-1, -1); header.delay = message.popLong(); header.sn = message.popLong(); header.id = message.popInt(); return header; }
/** * Pops a header from a message. Creates a new Header from the values contained by the message. * * @param message message that contains the info to build the header * @return a header builted from the values of contained by the message */ public static SEQHeader pop(Message message) { SEQHeader header = new SEQHeader(); header.order = message.popLong(); header.sn = message.popLong(); header.id = message.popInt(); return header; }
private void handleSendEvent(SendEvent conf) { Message message = conf.getMessage(); int id = message.popInt(); System.out.println("[Message received: " + message.peekString() + "]"); message.pushInt(id); DeliverEvent event = new DeliverEvent(); event.setMessage(message); event.setDestProcess(processes.getOther()); event.setSourceProcess(processes.getSelf()); event.setChannel(conf.getChannel()); event.setDir(Direction.DOWN); event.setSourceSession(this); try { event.init(); event.go(); } catch (AppiaEventException ex) { ex.printStackTrace(); } }
public void popMySelf(Message m) { number = m.popInt(); message = (RainMessage) m.popObject(); }