Class SynchronousConnectionOperationsFromReactiveConnectionOperations<T>
java.lang.Object
io.micronaut.data.connection.sync.SynchronousConnectionOperationsFromReactiveConnectionOperations<T>
- Type Parameters:
T- The connection type
- All Implemented Interfaces:
ConnectionOperations<T>
@Internal
public final class SynchronousConnectionOperationsFromReactiveConnectionOperations<T>
extends Object
implements ConnectionOperations<T>
Implementation of the synchronous connection operations using a reactive connection operations.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorsConstructorDescriptionSynchronousConnectionOperationsFromReactiveConnectionOperations(ReactorConnectionOperations<T> reactorConnectionOperations, ExecutorService blockingExecutorService) -
Method Summary
Modifier and TypeMethodDescription<R> Rexecute(ConnectionDefinition definition, Function<ConnectionStatus<T>, R> callback) Execute a connection within the context of the function.Obtains the current connection.booleanmanagesConnection(ConnectionStatus<T> connectionStatus) Determine whether the given connection status refers to a connection managed by thisConnectionOperationsinstance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.data.connection.ConnectionOperations
executeRead, executeWrite, getConnectionStatus
-
Constructor Details
-
SynchronousConnectionOperationsFromReactiveConnectionOperations
public SynchronousConnectionOperationsFromReactiveConnectionOperations(ReactorConnectionOperations<T> reactorConnectionOperations, ExecutorService blockingExecutorService)
-
-
Method Details
-
findConnectionStatus
Description copied from interface:ConnectionOperationsObtains the current connection.- Specified by:
findConnectionStatusin interfaceConnectionOperations<T>- Returns:
- The optional connection
-
execute
Description copied from interface:ConnectionOperationsExecute a connection within the context of the function.- Specified by:
executein interfaceConnectionOperations<T>- Type Parameters:
R- The result- Parameters:
definition- The connection definitioncallback- The call back- Returns:
- The result
-
managesConnection
Description copied from interface:ConnectionOperationsDetermine whether the given connection status refers to a connection managed by thisConnectionOperationsinstance.- Specified by:
managesConnectionin interfaceConnectionOperations<T>- Parameters:
connectionStatus- The connection status to verify- Returns:
- true if the connection is managed (i.e. created/supplied) by this operations instance
-