@FunctionalInterface public interface ConnectionObserver
Modifier and Type | Interface and Description |
---|---|
static interface |
ConnectionObserver.State
A marker interface for various state signals used in
onStateChange(Connection, State) |
Modifier and Type | Method and Description |
---|---|
default Context |
currentContext()
Connection listener
Context . |
static ConnectionObserver |
emptyListener()
Return a noop connection listener.
|
void |
onStateChange(Connection connection,
ConnectionObserver.State newState)
React on connection state change (e.g.
|
default void |
onUncaughtException(Connection connection,
Throwable error)
React on connection fatal error, will request a disconnecting state
change by default.
|
default ConnectionObserver |
then(ConnectionObserver other)
Chain together another
ConnectionObserver . |
static ConnectionObserver emptyListener()
default Context currentContext()
Context
.Context
or Context.empty()
default void onUncaughtException(Connection connection, Throwable error)
NettyInbound.receive()
subscriber.connection
- the remote connectionerror
- the failing causevoid onStateChange(Connection connection, ConnectionObserver.State newState)
connection
- the connection referencenewState
- the new Statedefault ConnectionObserver then(ConnectionObserver other)
ConnectionObserver
.other
- the next ConnectionObserver
ConnectionObserver