public interface ConnectionPoolComponent
Modifier and Type | Method and Description |
---|---|
PoolableConnection |
getConnection(Dbms dbms)
Returns a {link PoolableConnection} from this connection pool.
|
PoolableConnection |
getConnection(String uri,
String username,
char[] password)
Returns a {link PoolableConnection} from this connection pool.
|
long |
getMaxAge()
Returns the maximum age for recyclable connections.
|
int |
getMaxRetainSize()
Returns the maximum number of connection this pool will retain when
connections are returned.
|
int |
leaseSize()
Returns the current number of leased connections from the pool.
|
Connection |
newConnection(Dbms dbms)
Creates and returns a new
Connection for the given parameters. |
Connection |
newConnection(String uri,
String username,
char[] password)
Creates and returns a new
Connection for the given parameters. |
int |
poolSize()
Returns the current number of idle connections in the pool.
|
void |
returnConnection(PoolableConnection connection)
Returns a
PoolableConnection to the pool. |
void |
setMaxAge(long maxAge)
Deprecated.
This method will be removed in coming APIs. Use configuration
parameters instead.
|
void |
setMaxRetainSize(int size)
Deprecated.
This method will be removed in coming APIs. Use configuration
parameters instead.
|
PoolableConnection getConnection(String uri, String username, char[] password)
uri
- the connection URI for the connectorusername
- the user for the connectorpassword
- the password for the connectorPoolableConnection
from this connection poolPoolableConnection getConnection(Dbms dbms)
dbms
- the dbms to connect toPoolableConnection
from this connection poolConnection newConnection(String uri, String username, char[] password)
Connection
for the given parameters.
This method is called whenever the pool needs to allocate a new
Connection.uri
- the connection URI for the connectorusername
- the user for the connectorpassword
- the password for the connectorConnection
for the given parametersConnection newConnection(Dbms dbms)
Connection
for the given parameters.
This method is called whenever the pool needs to allocate a new
Connection.dbms
- the dbms to connect toConnection
for the given parametersvoid returnConnection(PoolableConnection connection)
PoolableConnection
to the pool. If the
PoolableConnection has expired or has a closed underlying connection, it
will be discarded from the pool.connection
- to return to the poolint poolSize()
int leaseSize()
int getMaxRetainSize()
@Deprecated void setMaxRetainSize(int size)
size
- is the maximum number of connection this pool will retain
when connections are returnedlong getMaxAge()
@Deprecated void setMaxAge(long maxAge)
maxAge
- the maximum age for recyclable connectionsCopyright © 2017 Speedment, Inc.. All rights reserved.