Class ReturnWrapperImpl

    • Constructor Detail

      • ReturnWrapperImpl

        public ReturnWrapperImpl​(org.zeromq.ZContext zContext,
                                 Object[] decodedReceivedMessage,
                                 Map<Long,​org.zeromq.ZMQ.Socket> socketMap)
        Construct a new ReturnWrapper.
        Parameters:
        zContext - ZContext; the ZContext needed to create sockets for returned messages
        decodedReceivedMessage - Object[]; decoded Sim0MQ message
        socketMap - Map<Long, Socket>; cache of created sockets for returned messages
    • Method Detail

      • sendToMaster

        public void sendToMaster​(byte[] data)
        Central portal to send a message to the master.
        Parameters:
        data - byte[]; the data to send
      • encodeReplyAndTransmit

        public void encodeReplyAndTransmit​(Boolean ackNack,
                                           Object[] payload)
                                    throws Sim0MQException,
                                           SerializationException
        Encode a String reply and transmit it while patching the message type id field by adding a vertical bar and a suffix.
        Specified by:
        encodeReplyAndTransmit in interface ReturnWrapper
        Parameters:
        ackNack - Boolean; if null, the payload is transmitted as is; if true, a boolean true is prepended to the payload; if false, a boolean false is prepended to the payload
        payload - Object []; payload of the reply message
        Throws:
        Sim0MQException - not sure if that can happen
        SerializationException - when an object in payload cannot be serialized
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object