| Modifier and Type | Class and Description |
|---|---|
| public static interface | ConnectionObserver.State
A marker interface for various state signals used in Specific protocol might implement more state type for instance request/response lifecycle. |
| Modifier and Type | Method and Description |
|---|---|
| public default Context | |
| public static ConnectionObserver | |
| public void | onStateChange(Connection
the connection reference connection, ConnectionObserver.the new State newStateReact on connection state change (e.g. http request or response). |
| public default void | onUncaughtException(Connection
the remote connection connection, Throwable the failing cause error)React on connection fatal error, will request a disconnecting state change by default. |
| public default ConnectionObserver | Returns: a new compositeConnectionObserverthe next other)ConnectionObserverChain together another |
| currentContext | back to summary |
|---|---|
| public default Context currentContext() Connection listener
| |
| emptyListener | back to summary |
|---|---|
| public static ConnectionObserver emptyListener() Return a noop connection listener.
| |
| onStateChange | back to summary |
|---|---|
| public void onStateChange(Connection connection, ConnectionObserver. React on connection state change (e.g. http request or response).
| |
| onUncaughtException | back to summary |
|---|---|
| public default void onUncaughtException(Connection connection, Throwable error) React on connection fatal error, will request a disconnecting state
change by default. It should only catch exceptions that can't be consumed by a
| |
| then | back to summary |
|---|---|
| public default ConnectionObserver then(ConnectionObserver other) Chain together another
| |
onStateChange(Connection, State)
Specific protocol might implement more state type for instance request/response lifecycle.
| Modifier and Type | Field and Description |
|---|---|
| public static final ConnectionObserver. | ACQUIRED
Propagated when a connection has been reused / acquired (keep-alive or pooling) |
| public static final ConnectionObserver. | CONFIGURED
Propagated when a connection is bound to a channelOperation and ready for user interaction |
| public static final ConnectionObserver. | CONNECTED
Propagated when a connection has been established and is available |
| public static final ConnectionObserver. | DISCONNECTING
Propagated when a connection is being fully closed |
| public static final ConnectionObserver. | RELEASED
Propagated when a connection has been released but not fully closed (keep-alive or pooling) |
| ACQUIRED | back to summary |
|---|---|
| public static final ConnectionObserver. Propagated when a connection has been reused / acquired (keep-alive or pooling) | |
| CONFIGURED | back to summary |
|---|---|
| public static final ConnectionObserver. Propagated when a connection is bound to a channelOperation and ready for user interaction | |
| CONNECTED | back to summary |
|---|---|
| public static final ConnectionObserver. Propagated when a connection has been established and is available | |
| DISCONNECTING | back to summary |
|---|---|
| public static final ConnectionObserver. Propagated when a connection is being fully closed | |
| RELEASED | back to summary |
|---|---|
| public static final ConnectionObserver. Propagated when a connection has been released but not fully closed (keep-alive or pooling) | |