- All Known Implementing Classes:
HikariConnectionPoolFactory
,TomcatConnectionPoolFactory
public interface ConnectionPoolFactory
Provides connection pool implementations
-
Method Summary
Modifier and TypeMethodDescriptioncreateConnectionPool
(ConnectionFactory connectionFactory, User user) Creates a connection pool wrapper based on the given database and user.static ConnectionPoolFactory
instance()
Returns the firstConnectionPoolFactory
implementation found by theServiceLoader
.static ConnectionPoolFactory
Returns theConnectionPoolFactory
implementation found by theServiceLoader
of the given type.
-
Method Details
-
createConnectionPool
ConnectionPoolWrapper createConnectionPool(ConnectionFactory connectionFactory, User user) throws DatabaseException Creates a connection pool wrapper based on the given database and user.- Parameters:
connectionFactory
- the connection factoryuser
- the user to base the pooled connections on- Returns:
- a connection pool wrapper based on the given user
- Throws:
DatabaseException
- in case of an exception
-
instance
Returns theConnectionPoolFactory
implementation found by theServiceLoader
of the given type.- Parameters:
classname
- the classname of the required connection pool provider- Returns:
- a
ConnectionPoolFactory
implementation of the given type from theServiceLoader
. - Throws:
IllegalStateException
- in case no suchConnectionPoolFactory
implementation is available.
-
instance
Returns the firstConnectionPoolFactory
implementation found by theServiceLoader
.- Returns:
- a
ConnectionPoolFactory
implementation from theServiceLoader
. - Throws:
IllegalStateException
- in case noConnectionPoolFactory
implementation is available.
-