Class MessageStream

    • Constructor Detail

      • MessageStream

        protected MessageStream()
    • Method Detail

      • process

        public void process()
                     throws java.io.IOException,
                            java.lang.IllegalStateException,
                            java.lang.IllegalArgumentException
        Begin message stream processing loop in case of an active stream working in model PULL. In this case the realization must call method fireStreamStart() at the beginning of processing then extract messages from it's source and call for each of them method fireStreamMessage(AbstractTraceMessage), and in case of stream end (stream may never end) - method fireStreamEnd(boolean) with the flag marking either a normal end or abort. Method returns when all messages are extracted and processed or when the message stream closure is not normal.

        The method realization is empty by default which corresponds with the model PUSH. For the streams working in this model and processing messages from other active sources the corresponding calls must be done in the same order in the corresponding listeners.

        Throws:
        java.io.IOException - Input-Output error.
        java.lang.IllegalStateException - Processing has already begun.
        java.lang.IllegalArgumentException - Error in stream.
      • fireStreamStart

        protected void fireStreamStart()
        Sends stream begin message to all listeners. Exceptions from the listeners are being ignored.
      • fireStreamMessage

        protected void fireStreamMessage​(AbstractTraceMessage msg)
        Sends message to all listeners. Exceptions from the listeners are being ignored.
      • fireStreamEnd

        protected void fireStreamEnd​(boolean normal)
        Sends stream end message to all listeners. Exceptions from the listeners are being ignored.