public abstract class SqlClientPool extends java.lang.Object implements ReactiveConnectionPool
Pool
instances.
N.B. the Vert.x notion of pool is not to be confused with
the traditional JDBC notion of pool: there is a fundamental
difference as the Vert.x pool should not be shared across
threads or with other Vert.x contexts.
For this reason the Reactive SessionFactory won't hold on
to a (single) instance of Pool
, but rather have a
supplier, to produce a new Pool
instance within
each context.Constructor and Description |
---|
SqlClientPool() |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletionStage<ReactiveConnection> |
getConnection()
Obtain a reactive connection, returning the connection
via a
CompletionStage . |
java.util.concurrent.CompletionStage<ReactiveConnection> |
getConnection(java.lang.String tenantId)
Obtain a reactive connection for the given tenant id,
returning the connection via a
CompletionStage . |
protected abstract io.vertx.sqlclient.Pool |
getPool() |
ReactiveConnection |
getProxyConnection()
Obtain a lazily-initializing reactive connection.
|
ReactiveConnection |
getProxyConnection(java.lang.String tenantId)
Obtain a lazily-initializing reactive connection for the
given tenant id.
|
protected abstract org.hibernate.engine.jdbc.spi.SqlStatementLogger |
getSqlStatementLogger() |
protected io.vertx.sqlclient.Pool |
getTenantPool(java.lang.String tenantId)
Get a
Pool for the specified tenant. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCloseFuture
protected abstract io.vertx.sqlclient.Pool getPool()
Pool
for the current context.protected abstract org.hibernate.engine.jdbc.spi.SqlStatementLogger getSqlStatementLogger()
SqlStatementLogger
for logging SQL
statements as they are executedprotected io.vertx.sqlclient.Pool getTenantPool(java.lang.String tenantId)
Pool
for the specified tenant.
This is an unimplemented operation which must be overridden by subclasses which support multitenancy.
tenantId
- the id of the tenantjava.lang.UnsupportedOperationException
- if multitenancy is not supportedgetConnection(String)
public java.util.concurrent.CompletionStage<ReactiveConnection> getConnection()
ReactiveConnectionPool
CompletionStage
.getConnection
in interface ReactiveConnectionPool
public java.util.concurrent.CompletionStage<ReactiveConnection> getConnection(java.lang.String tenantId)
ReactiveConnectionPool
CompletionStage
.getConnection
in interface ReactiveConnectionPool
public ReactiveConnection getProxyConnection()
ReactiveConnectionPool
ReactiveConnection
is first used.getProxyConnection
in interface ReactiveConnectionPool
public ReactiveConnection getProxyConnection(java.lang.String tenantId)
ReactiveConnectionPool
ReactiveConnection
is
first used.getProxyConnection
in interface ReactiveConnectionPool