public abstract class SqlConnectionFactoryBase extends Object implements ConnectionFactory
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cachePreparedStatements |
protected CloseFuture |
clientCloseFuture |
protected EventLoopContext |
context |
protected String |
database |
protected NetClient |
netClient |
protected String |
password |
protected int |
preparedStatementCacheSize |
protected Predicate<String> |
preparedStatementCacheSqlFilter |
protected Map<String,String> |
properties |
protected SocketAddress |
socketAddress |
protected String |
username |
| Modifier | Constructor and Description |
|---|---|
protected |
SqlConnectionFactoryBase(EventLoopContext context,
SqlConnectOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
close(Promise<Void> promise)
Close this resource, the
completion promise must be notified when the operation has completed. |
protected abstract void |
configureNetClientOptions(NetClientOptions netClientOptions)
Apply the configuration to the
NetClientOptions for connecting to the database. |
void |
connect(Promise<Connection> promise)
Connect to the database and returns a connection.
|
protected abstract void |
doConnectInternal(Promise<Connection> promise)
Perform establishing connection to the server.
|
protected abstract void |
initializeConfiguration(SqlConnectOptions options)
Initialize the configuration after the common configuration have been initialized.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasEventLoopContextprotected final NetClient netClient
protected final EventLoopContext context
protected final SocketAddress socketAddress
protected final String username
protected final String password
protected final String database
protected final boolean cachePreparedStatements
protected final int preparedStatementCacheSize
protected final CloseFuture clientCloseFuture
protected SqlConnectionFactoryBase(EventLoopContext context, SqlConnectOptions options)
public void connect(Promise<Connection> promise)
ConnectionFactoryconnect in interface ConnectionFactorypublic void close(Promise<Void> promise)
Closeablecompletion promise must be notified when the operation has completed.close in interface Closeableclose in interface ConnectionFactorypromise - the promise to signal when close has completedprotected abstract void initializeConfiguration(SqlConnectOptions options)
options - the concrete options for initializing configuration by a specific connection factory.protected abstract void configureNetClientOptions(NetClientOptions netClientOptions)
NetClientOptions for connecting to the database.netClientOptions - NetClient options to applyprotected abstract void doConnectInternal(Promise<Connection> promise)
promise - the result handlerCopyright © 2021. All rights reserved.