Interface ConnectionContext


public interface ConnectionContext
Context interface providing callbacks and handlers for connection strategies.

This interface allows connection strategies to interact with the broader connection management system in a decoupled way, without depending on specific implementation details.

  • Method Details

    • onMessageReceived

      void onMessageReceived(InboundMessage message)
      Called when a message is received from the transport.
      Parameters:
      message - the received inbound message
    • onStateChanged

      void onStateChanged(ConnectionState newState)
      Called when the connection state changes.
      Parameters:
      newState - the new connection state
    • onError

      void onError(Throwable error)
      Called when a connection error occurs.
      Parameters:
      error - the error that occurred
    • onConnectionEstablished

      void onConnectionEstablished()
      Called when the connection is successfully established and authenticated.
    • onConnectionLost

      void onConnectionLost()
      Called when the connection is lost or closed.
    • getPipeline

      Pipeline getPipeline()
      Gets the pipeline for this connection context.
      Returns:
      the connection pipeline