Interface RequestHandler<R>


  • public interface RequestHandler<R>
    Handles requests.
    Author:
    Daniel Sagenschneider
    • Method Detail

      • handleRequest

        void handleRequest​(R request)
                    throws java.lang.IllegalStateException

        Handles a request.

        This may only be invoked by the Socket Thread.

        Parameters:
        request - Request.
        Throws:
        java.lang.IllegalStateException - If invoked from another Thread.
      • sendImmediateData

        void sendImmediateData​(StreamBuffer<java.nio.ByteBuffer> immediateHead)
                        throws java.lang.IllegalStateException

        Sends data immediately.

        This may only be invoked by the Socket Thread.

        Parameters:
        immediateHead - Head StreamBuffer to linked list of StreamBuffer instances of data to send immediately.
        Throws:
        java.lang.IllegalStateException - If invoked from another Thread.
      • closeConnection

        void closeConnection​(java.lang.Throwable exception)
        Allows to close connection.
        Parameters:
        exception - Optional Exception for the cause of closing the connection. null to indicate normal close.