Class DefaultReactiveConnectionStatus<C>
java.lang.Object
io.micronaut.data.connection.reactive.DefaultReactiveConnectionStatus<C>
- Type Parameters:
C- The connection type
- All Implemented Interfaces:
io.micronaut.core.propagation.PropagatedContextElement, ConnectionStatus<C>, ReactiveConnectionStatus<C>
@Internal
public final class DefaultReactiveConnectionStatus<C>
extends Object
implements ReactiveConnectionStatus<C>
The default reactive connection status.
- Since:
- 4.2.0
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultReactiveConnectionStatus(C connection, ConnectionDefinition definition, ReactorConnectionOperations<C> connectionOperations, boolean isNew) DefaultReactiveConnectionStatus(C connection, ConnectionDefinition definition, ReactorConnectionOperations<C> connectionOperations, boolean isNew, @Nullable Executor executor) -
Method Summary
Modifier and TypeMethodDescriptionThe connection representation.The connection definition.@Nullable Executor@Nullable reactor.core.scheduler.SchedulerbooleanisConnectionOf(ReactorConnectionOperations<C> connectionOperations) booleanisNew()A new connection value.org.reactivestreams.Publisher<Void> org.reactivestreams.Publisher<Void> onComplete(Supplier<org.reactivestreams.Publisher<Void>> closeConnection) <T> reactor.core.publisher.Mono<T> onConnectionExecutor(Supplier<? extends reactor.core.publisher.Mono<T>> work) Run the work on the connection's executor, if it has one.<T> reactor.core.publisher.Flux<T> onConnectionExecutorFlux(Supplier<? extends reactor.core.publisher.Flux<T>> work) Run the work on the connection's executor, if it has one.org.reactivestreams.Publisher<Void> voidregisterReactiveSynchronization(ReactiveConnectionSynchronization synchronization) Register reactive connection synchronization.voidregisterSynchronization(ConnectionSynchronization synchronization) Register connection synchronization.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ConnectionStatus
propagate, propagate, propagate
-
Constructor Details
-
DefaultReactiveConnectionStatus
public DefaultReactiveConnectionStatus(C connection, ConnectionDefinition definition, ReactorConnectionOperations<C> connectionOperations, boolean isNew) -
DefaultReactiveConnectionStatus
@Internal public DefaultReactiveConnectionStatus(C connection, ConnectionDefinition definition, ReactorConnectionOperations<C> connectionOperations, boolean isNew, @Nullable Executor executor) - Parameters:
connection- The connectiondefinition- The connection definitionconnectionOperations- The connection operationsisNew- Whether the connection was opened for this statusexecutor- The executor the connection must be used on, if it is bound to a thread- Since:
- 5.3.0
-
-
Method Details
-
getExecutor
- Returns:
- The executor the connection must be used on, or
nullif it can be used from any thread - Since:
- 5.3.0
-
getScheduler
@Internal public @Nullable reactor.core.scheduler.Scheduler getScheduler()- Returns:
- The scheduler of the connection's executor, or
nullif it can be used from any thread - Since:
- 5.3.0
-
onConnectionExecutor
@Internal public <T> reactor.core.publisher.Mono<T> onConnectionExecutor(Supplier<? extends reactor.core.publisher.Mono<T>> work) Run the work on the connection's executor, if it has one.- Type Parameters:
T- The result type- Parameters:
work- The work- Returns:
- The result
- Since:
- 5.3.0
-
onConnectionExecutorFlux
@Internal public <T> reactor.core.publisher.Flux<T> onConnectionExecutorFlux(Supplier<? extends reactor.core.publisher.Flux<T>> work) Run the work on the connection's executor, if it has one.- Type Parameters:
T- The result type- Parameters:
work- The work- Returns:
- The result
- Since:
- 5.3.0
-
isConnectionOf
-
isNew
public boolean isNew()Description copied from interface:ConnectionStatusA new connection value. Based on the propagation value the connection manager might decide to reuse the existing connection.- Specified by:
isNewin interfaceConnectionStatus<C>- Returns:
- true if the connection is new
-
getConnection
Description copied from interface:ConnectionStatusThe connection representation.- Specified by:
getConnectionin interfaceConnectionStatus<C>- Returns:
- The connection representation
-
getDefinition
Description copied from interface:ConnectionStatusThe connection definition.- Specified by:
getDefinitionin interfaceConnectionStatus<C>- Returns:
- The connection definition
-
registerSynchronization
Description copied from interface:ConnectionStatusRegister connection synchronization.- Specified by:
registerSynchronizationin interfaceConnectionStatus<C>- Parameters:
synchronization- The synchronization
-
registerReactiveSynchronization
Description copied from interface:ReactiveConnectionStatusRegister reactive connection synchronization.- Specified by:
registerReactiveSynchronizationin interfaceReactiveConnectionStatus<C>- Parameters:
synchronization- The synchronization
-
onComplete
-
onError
-
onCancel
-