Module id.ICE
Package id.ICE

Class MessageResponse


  • public class MessageResponse
    extends Object
    Response message sent to the client
    • Constructor Detail

      • MessageResponse

        public MessageResponse​(ByteBuffer message)
        Parameters:
        message - message to be sent to the client
    • Method Detail

      • withCloseOnResponse

        public MessageResponse withCloseOnResponse()

        Close the connection after response is sent.

      • withIgnoreNextRequest

        public MessageResponse withIgnoreNextRequest()

        By default every time your service provides a *response* message, ICE sends it back to the client and waits for the next *request* message from it (see ICE looper description).

        With this flag set ICE will not wait for next request from the client instead it will proceed to MessageService for another message which needs to be send to the client.

        You may want to use it when you need your service to send stream of messages.

      • withErrorHandler

        public MessageResponse withErrorHandler​(Consumer<Throwable> errorHandler)
        Set up error handler which will be called in case of an error delivering the message response to the client.
      • getMessage

        public ByteBuffer getMessage()
        Message response
      • shouldCloseOnResponse

        public boolean shouldCloseOnResponse()
        Return whether withCloseOnResponse() is set or not
      • shouldIgnoreNextRequest

        public boolean shouldIgnoreNextRequest()
        Return whether withIgnoreNextRequest() is set or not
      • getErrorHandler

        public Optional<Consumer<Throwable>> getErrorHandler()
        Return error handler if any