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.voidCalled when the connection is successfully established and authenticated.voidCalled when the connection is lost or closed.voidCalled when a connection error occurs.voidonMessageReceived(InboundMessage message) Called when a message is received from the transport.voidonStateChanged(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
-