Module id.ICE
Package id.ICE

Interface MessageService

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    public interface MessageService
    Processing of client messages are done through this interface. It needs to be thread safe because it can be called by multiple threads.

    Every message in ICE represented as a ByteBuffer object. That allows you to get control of its actual format.

    • Method Detail

      • process

        CompletableFuture<MessageResponse> process​(MessageRequest message)
        This method is being called by the server to process received messages.
        message - Received client message.
        once the returned future is complete the response will be processed and sent back to the client. Server decides what to do with the connection based on returned result:
        • if response is null the connection is closed
        • otherwise we will wait for next message from the client