Package com.lucimber.dbus.connection
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 Summary
Modifier and TypeMethodDescriptionGets the pipeline for this connection context.void
Called when the connection is successfully established and authenticated.void
Called when the connection is lost or closed.void
Called when a connection error occurs.void
onMessageReceived
(InboundMessage message) Called when a message is received from the transport.void
onStateChanged
(ConnectionState newState) Called when the connection state changes.
-
Method Details
-
onMessageReceived
Called when a message is received from the transport.- Parameters:
message
- the received inbound message
-
onStateChanged
Called when the connection state changes.- Parameters:
newState
- the new connection state
-
onError
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
-