public class DatabaseEnginePool extends Object implements AutoCloseable
DatabaseEngine instances.| Modifier and Type | Method and Description |
|---|---|
DatabaseEngine |
borrow()
Borrows a database engine from the pool.
|
DatabaseEngine |
borrow(long borrowMaxWaitMillis)
Borrows a database engine from the pool.
|
void |
close()
Closes the pool.
|
static DatabaseEnginePool |
getConnectionPool(Map<String,String> properties)
Creates a new
DatabaseEnginePool. |
static DatabaseEnginePool |
getConnectionPool(Map<String,String> properties,
Consumer<DatabaseEngine> engineModifier)
Creates a new
DatabaseEnginePool. |
static DatabaseEnginePool |
getConnectionPool(PdbProperties properties)
Creates a new
DatabaseEnginePool. |
static DatabaseEnginePool |
getConnectionPool(PdbProperties properties,
Consumer<DatabaseEngine> engineModifier)
Creates a new
DatabaseEnginePool. |
static DatabaseEnginePool |
getConnectionPool(Properties properties)
Creates a new
DatabaseEnginePool. |
static DatabaseEnginePool |
getConnectionPool(Properties properties,
Consumer<DatabaseEngine> engineModifier)
Creates a new
DatabaseEnginePool. |
int |
getMaxTotal()
Gets the maximum number of connections.
|
int |
getNumActive()
Gets the number of borrowed connections.
|
String |
getPoolJdbc()
Gets the Pool JDBC string.
|
String |
getPoolName()
Gets the pool name.
|
boolean |
isClosed()
Returns whether the pool is closed or not.
|
public DatabaseEngine borrow()
DatabaseEngine.close() to return the borrowed database
engine to pool.public DatabaseEngine borrow(long borrowMaxWaitMillis)
DatabaseEngine.close() to return the borrowed database
engine to pool.borrowMaxWaitMillis - the time to wait in milliseconds for an object to become available.public void close()
close in interface AutoCloseablepublic boolean isClosed()
public String getPoolJdbc()
public int getMaxTotal()
public int getNumActive()
public String getPoolName()
public static DatabaseEnginePool getConnectionPool(Map<String,String> properties, Consumer<DatabaseEngine> engineModifier)
DatabaseEnginePool.properties - the configured database and pool properties.engineModifier - the database engine modifier to fit the application needs.public static DatabaseEnginePool getConnectionPool(Map<String,String> properties)
DatabaseEnginePool.properties - the configured database and pool properties.public static DatabaseEnginePool getConnectionPool(Properties properties, Consumer<DatabaseEngine> engineModifier)
DatabaseEnginePool.properties - the configured database and pool properties.engineModifier - the database engine modifier to fit the application needs.public static DatabaseEnginePool getConnectionPool(Properties properties)
DatabaseEnginePool.properties - the configured database and pool properties.public static DatabaseEnginePool getConnectionPool(PdbProperties properties, Consumer<DatabaseEngine> engineModifier)
DatabaseEnginePool.properties - the configured database and pool properties.engineModifier - the database engine modifier to fit the application needs.public static DatabaseEnginePool getConnectionPool(PdbProperties properties)
DatabaseEnginePool.properties - the configured database and pool properties.Copyright © 2021 Feedzai. All rights reserved.