- 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 ConnectionPoolFactoryinstance()Returns the firstConnectionPoolFactoryimplementation found by theServiceLoader.static ConnectionPoolFactoryReturns theConnectionPoolFactoryimplementation found by theServiceLoaderof the given type.
-
Method Details
-
createConnectionPool
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 theConnectionPoolFactoryimplementation found by theServiceLoaderof the given type.- Parameters:
classname- the classname of the required connection pool factory- Returns:
- a
ConnectionPoolFactoryimplementation of the given type from theServiceLoader. - Throws:
IllegalStateException- in case no suchConnectionPoolFactoryimplementation is available.
-
instance
Returns the firstConnectionPoolFactoryimplementation found by theServiceLoader.- Returns:
- a
ConnectionPoolFactoryimplementation from theServiceLoader. - Throws:
IllegalStateException- in case noConnectionPoolFactoryimplementation is available.
-