public abstract class ConnectionPool<T>
extends java.lang.Object
A simple, non-blocking pool implementation
Constructor and Description |
---|
ConnectionPool() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the pool
|
protected abstract void |
connect(Handler<T> connectHandler,
Context context)
Implement this method in a sub-class to implement the actual connection creation for the specific type of connection
|
void |
connectionClosed()
Inform the pool that the connection has been closed externally.
|
void |
getConnection(Handler<T> handler,
Context context) |
int |
getMaxPoolSize()
Returns the maximum number of connections in the pool
|
void |
report() |
void |
returnConnection(T conn)
Return a connection to the pool so it can be used by others.
|
void |
setMaxPoolSize(int maxConnections)
Set the maximum pool size to the value specified by
maxConnections |
public void setMaxPoolSize(int maxConnections)
maxConnections
The client will maintain up to maxConnections
HTTP connections in an internal pool
public int getMaxPoolSize()
public void report()
public void connectionClosed()
public void returnConnection(T conn)
public void close()