Class StringAsyncEntityProducer

    • Field Detail

      • content

        private final java.nio.CharBuffer content
      • exception

        private final java.util.concurrent.atomic.AtomicReference<java.lang.Exception> exception
    • Constructor Detail

      • StringAsyncEntityProducer

        public StringAsyncEntityProducer​(java.lang.CharSequence content,
                                         int bufferSize,
                                         int fragmentSizeHint,
                                         ContentType contentType)
      • StringAsyncEntityProducer

        public StringAsyncEntityProducer​(java.lang.CharSequence content,
                                         int bufferSize,
                                         ContentType contentType)
      • StringAsyncEntityProducer

        public StringAsyncEntityProducer​(java.lang.CharSequence content,
                                         ContentType contentType)
      • StringAsyncEntityProducer

        public StringAsyncEntityProducer​(java.lang.CharSequence content)
    • Method Detail

      • availableData

        protected int availableData()
        Description copied from class: AbstractCharAsyncEntityProducer
        Returns the number of bytes immediately available for output. This method can be used as a hint to control output events of the underlying I/O session.
        Specified by:
        availableData in class AbstractCharAsyncEntityProducer
        Returns:
        the number of bytes immediately available for output
      • produceData

        protected void produceData​(StreamChannel<java.nio.CharBuffer> channel)
                            throws java.io.IOException
        Description copied from class: AbstractCharAsyncEntityProducer
        Triggered to signal the ability of the underlying char channel to accept more data. The data producer can choose to write data immediately inside the call or asynchronously at some later point.

        StreamChannel passed to this method is threading-safe.

        Specified by:
        produceData in class AbstractCharAsyncEntityProducer
        Parameters:
        channel - the data channel capable to accepting more data.
        Throws:
        java.io.IOException
      • failed

        public void failed​(java.lang.Exception cause)
        Description copied from interface: AsyncEntityProducer
        Triggered to signal a failure in data generation.
        Parameters:
        cause - the cause of the failure.
      • getException

        public java.lang.Exception getException()