Package io.micronaut.data.connection
Interface ConnectionStatus<C>
- Type Parameters:
C- The connection type
- All Superinterfaces:
io.micronaut.core.propagation.PropagatedContextElement
- All Known Subinterfaces:
ReactiveConnectionStatus<C>
- All Known Implementing Classes:
DefaultConnectionStatus,DefaultReactiveConnectionStatus
public interface ConnectionStatus<C>
extends io.micronaut.core.propagation.PropagatedContextElement
The connection status.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionThe connection representation.@NonNull ConnectionDefinitionThe connection definition.booleanisNew()A new connection value.default <V> VPropagated the currentPropagatedContextwith added connection status.default voidPropagated the currentPropagatedContextwith added connection status.default <V> VPropagated the currentPropagatedContextwith added connection status.voidregisterSynchronization(@NonNull ConnectionSynchronization synchronization) Register connection synchronization.
-
Method Details
-
isNew
boolean isNew()A new connection value. Based on the propagation value the connection manager might decide to reuse the existing connection.- Returns:
- true if the connection is new
-
getConnection
The connection representation.- Returns:
- The connection representation
-
getDefinition
The connection definition.- Returns:
- The connection definition
-
registerSynchronization
Register connection synchronization.- Parameters:
synchronization- The synchronization
-
propagate
default <V> V propagate(io.micronaut.core.propagation.PropagatedContext propagatedContext, Supplier<V> supplier) Propagated the currentPropagatedContextwith added connection status.- Type Parameters:
V- The value type- Parameters:
propagatedContext- The propagated contextsupplier- The supplier- Returns:
- The value
- Since:
- 5.0
-
propagate
Propagated the currentPropagatedContextwith added connection status.- Type Parameters:
V- The value type- Parameters:
supplier- The supplier- Returns:
- The value
- Since:
- 5.0
-
propagate
Propagated the currentPropagatedContextwith added connection status.- Parameters:
runnable- The runnable- Since:
- 5.0
-