Package com.qfs.msg

Interface IMessageChannel<I,​E>

    • Method Detail

      • getTopic

        String getTopic()
        Retrieves the topic of this channel.
        Returns:
        The channel's topic
      • newMessage

        <T extends IIMessage<T,​E> newMessage​(T identifier)
        Creates a new message that will collect data elements from the source, and then be sent through the channel.
        Type Parameters:
        T - Type of the message identifier.
        Parameters:
        identifier - the identifier of the message
        Returns:
        the created message
      • send

        <T extends I> void send​(IMessage<T,​E> message)
        Sends a message through the channel. The channel always supports sending the message instances it has created, but only optionally supports sending other message types.
        Note : In some message implementations, the publishing of partial messages is already done during the IMessage.append(IMessageChunk) method (for example, on store messages in non-accumulating mode). In that case, calling this method will have no further effect.
        Type Parameters:
        T - Type of the message identifier.
        Parameters:
        message - The message to send through the channel.
      • sendMessage

        <T extends I> void sendMessage​(T identifier,
                                       Collection<? extends E> elements)
        Creates a new message and sends it through the channel. This is a utility method that combines creating the message, creating a message chunk to hold the elements and appending it to the message, and then sending the message.
        Type Parameters:
        T - Type of the message identifier.
        Parameters:
        identifier - The identifier of the new message to create.
        elements - The elements to add in the message to send through the channel.
        See Also:
        newMessage(Object), IMessage.newChunk(), IMessage.append(IMessageChunk), send(IMessage)
      • withMessageHandler

        IMessageChannel<I,​E> withMessageHandler​(IMessageHandler<I> messageHandler)
        Installs a message handler on this channel.
        Parameters:
        messageHandler - the new message handler
        Returns:
        this channel after its message handler has been updated