Package ru.curs.celesta
Class InternalConnectionPool
java.lang.Object
ru.curs.celesta.InternalConnectionPool
- All Implemented Interfaces:
AutoCloseable,ConnectionPool
Database connection pool.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes up connection pool and all its connections, and makes it inaccessible.static InternalConnectionPoolcreate(ConnectionPoolConfiguration configuration) Factory method for connection pool creation.get()Returns a connection from pool.booleanisClosed()If the poll is closed then this method will return true.poolSize()Returns the number of connections available in the pool.voidsetDbAdaptor(DBAdaptor dbAdaptor) Sets DB adaptor.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ru.curs.celesta.ConnectionPool
commit
-
Method Details
-
create
Factory method for connection pool creation.- Parameters:
configuration- connection pool configuration.- Returns:
-
setDbAdaptor
Sets DB adaptor.- Specified by:
setDbAdaptorin interfaceConnectionPool- Parameters:
dbAdaptor- DB adaptor.
-
get
Returns a connection from pool.- Specified by:
getin interfaceConnectionPool- Returns:
- connection from pool
-
close
public void close()Closes up connection pool and all its connections, and makes it inaccessible.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnectionPool
-
poolSize
Returns the number of connections available in the pool.- Returns:
- count of available connections
-
isClosed
public boolean isClosed()If the poll is closed then this method will return true.- Specified by:
isClosedin interfaceConnectionPool- Returns:
trueif the pool is closed;falseotherwise.
-