|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
CL
- public interface HostConnectionPool<CL>
Pool of connections for a single host
Method Summary | |
---|---|
void |
addLatencySample(long lastLatency,
long now)
Add a single latency sample after an operation on a connection belonging to this pool |
Connection<CL> |
borrowConnection(int timeout)
Borrow a connection from the host. |
boolean |
closeConnection(Connection<CL> connection)
Close this connection and update internal state |
int |
getActiveConnectionCount()
Get number of open connections including any that are currently borrowed and those that are currently idel |
int |
getBlockedThreadCount()
Get number of threads blocked waiting for a free connection |
int |
getBusyConnectionCount()
Get number of currently borrowed connections |
Host |
getHost()
Get the host to which this pool is associated |
int |
getIdleConnectionCount()
Return the number of idle active connections. |
double |
getMeanLatency()
Get the average latency as calculated by the scoring strategy |
int |
getPendingConnectionCount()
Get the number of pending connection open attempts |
double |
getScore()
Return implementation specific score to be used by weighted pool selection algorithms |
int |
growConnections(int numConnections)
Create numConnections new connections and add them to the |
boolean |
isShutdown()
Determine if pool is shut down. |
void |
markAsDown(ConnectionException reason)
Shut down the host so no more connections may be created when borrowConnections is called and connections will be terminated when returnConnection is called. |
Connection<CL> |
openConnection()
This open is different from borrowConnection in that it actually creates a new connection without waiting for one that may be idle. |
boolean |
returnConnection(Connection<CL> connection)
Return a connection to the host's pool. |
void |
shutdown()
Completely shut down this connection pool as part of a client shutdown |
Method Detail |
---|
Connection<CL> borrowConnection(int timeout) throws ConnectionException
timeout
-
ConnectionException
Connection<CL> openConnection() throws ConnectionException
ConnectionException
boolean returnConnection(Connection<CL> connection)
connection
-
boolean closeConnection(Connection<CL> connection)
connection
-
void markAsDown(ConnectionException reason)
void shutdown()
int growConnections(int numConnections) throws ConnectionException, InterruptedException
ConnectionException
InterruptedException
Host getHost()
int getActiveConnectionCount()
int getPendingConnectionCount()
int getBlockedThreadCount()
int getIdleConnectionCount()
int getBusyConnectionCount()
boolean isShutdown()
double getScore()
double getMeanLatency()
void addLatencySample(long lastLatency, long now)
lastLatency
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |