Package ru.curs.celesta
Class InternalConnectionPool
- java.lang.Object
-
- ru.curs.celesta.InternalConnectionPool
-
- All Implemented Interfaces:
AutoCloseable
,ConnectionPool
public final class InternalConnectionPool extends Object implements ConnectionPool
Database connection pool.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes up connection pool and all its connections, and makes it inaccessible.static InternalConnectionPool
create(ConnectionPoolConfiguration configuration)
Factory method for connection pool creation.Connection
get()
Returns a connection from pool.boolean
isClosed()
If the poll is closed then this method will return true.Object
poolSize()
Returns the number of connections available in the pool.void
setDbAdaptor(DBAdaptor dbAdaptor)
Sets DB adaptor.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ru.curs.celesta.ConnectionPool
commit
-
-
-
-
Method Detail
-
create
public static InternalConnectionPool create(ConnectionPoolConfiguration configuration)
Factory method for connection pool creation.- Parameters:
configuration
- connection pool configuration.- Returns:
-
setDbAdaptor
public void setDbAdaptor(DBAdaptor dbAdaptor)
Sets DB adaptor.- Specified by:
setDbAdaptor
in interfaceConnectionPool
- Parameters:
dbAdaptor
- DB adaptor.
-
get
public Connection get()
Returns a connection from pool.- Specified by:
get
in interfaceConnectionPool
- Returns:
- connection from pool
-
close
public void close()
Closes up connection pool and all its connections, and makes it inaccessible.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConnectionPool
-
poolSize
public Object 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:
isClosed
in interfaceConnectionPool
- Returns:
true
if the pool is closed;false
otherwise.
-
-