T - routeC - connection object@Contract(threading=SAFE) @Experimental public class LaxConnPool<T,C extends ModalCloseable> extends Object implements ManagedConnPool<T,C>
| Constructor and Description |
|---|
LaxConnPool(int defaultMaxPerRoute) |
LaxConnPool(int defaultMaxPerRoute,
TimeValue timeToLive,
PoolReusePolicy policy,
ConnPoolListener<T> connPoolListener) |
LaxConnPool(int defaultMaxPerRoute,
TimeValue timeToLive,
PoolReusePolicy policy,
DisposalCallback<C> disposalCallback,
ConnPoolListener<T> connPoolListener) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream and releases any system resources associated with it.
|
void |
close(CloseMode closeMode)
Closes this process or endpoint and releases any system resources associated
with it.
|
void |
closeExpired() |
void |
closeIdle(TimeValue idleTime) |
void |
enumAvailable(Callback<PoolEntry<T,C>> callback) |
void |
enumLeased(Callback<PoolEntry<T,C>> callback) |
int |
getDefaultMaxPerRoute() |
int |
getMaxPerRoute(T route) |
int |
getMaxTotal() |
Set<T> |
getRoutes() |
PoolStats |
getStats(T route) |
PoolStats |
getTotalStats() |
boolean |
isShutdown() |
Future<PoolEntry<T,C>> |
lease(T route,
Object state) |
Future<PoolEntry<T,C>> |
lease(T route,
Object state,
Timeout requestTimeout,
FutureCallback<PoolEntry<T,C>> callback)
Attempts to lease a connection for the given route and with the given
state from the pool.
|
void |
release(PoolEntry<T,C> entry,
boolean reusable)
Releases the pool entry back to the pool.
|
void |
setDefaultMaxPerRoute(int max) |
void |
setMaxPerRoute(T route,
int max) |
void |
setMaxTotal(int max) |
String |
toString()
Returns a string representation of the object.
|
void |
validatePendingRequests() |
public LaxConnPool(int defaultMaxPerRoute)
public LaxConnPool(int defaultMaxPerRoute,
TimeValue timeToLive,
PoolReusePolicy policy,
ConnPoolListener<T> connPoolListener)
public LaxConnPool(int defaultMaxPerRoute,
TimeValue timeToLive,
PoolReusePolicy policy,
DisposalCallback<C> disposalCallback,
ConnPoolListener<T> connPoolListener)
public void close()
Closeableclose in interface Closeableclose in interface AutoCloseablepublic void close(CloseMode closeMode)
ModalCloseableclose in interface ModalCloseablecloseMode - How to close the receiver.public void closeExpired()
closeExpired in interface ConnPoolControl<T>public void closeIdle(TimeValue idleTime)
closeIdle in interface ConnPoolControl<T>public int getDefaultMaxPerRoute()
getDefaultMaxPerRoute in interface ConnPoolControl<T>public int getMaxPerRoute(T route)
getMaxPerRoute in interface ConnPoolControl<T>public int getMaxTotal()
getMaxTotal in interface ConnPoolControl<T>public Set<T> getRoutes()
getRoutes in interface ConnPoolControl<T>public PoolStats getStats(T route)
getStats in interface ConnPoolStats<T>public PoolStats getTotalStats()
getTotalStats in interface ConnPoolStats<T>public boolean isShutdown()
public Future<PoolEntry<T,C>> lease(T route, Object state, Timeout requestTimeout, FutureCallback<PoolEntry<T,C>> callback)
ConnPoollease in interface ConnPool<T,C extends ModalCloseable>route - route of the connection.state - arbitrary object that represents a particular state
(usually a security principal or a unique token identifying
the user whose credentials have been used while establishing the connection).
May be null.requestTimeout - request timeout.callback - operation completion callback.public void release(PoolEntry<T,C> entry, boolean reusable)
ConnPoolrelease in interface ConnPool<T,C extends ModalCloseable>entry - pool entry leased from the poolreusable - flag indicating whether or not the released connection
is in a consistent state and is safe for further use.public void setDefaultMaxPerRoute(int max)
setDefaultMaxPerRoute in interface ConnPoolControl<T>public void setMaxPerRoute(T route, int max)
setMaxPerRoute in interface ConnPoolControl<T>public void setMaxTotal(int max)
setMaxTotal in interface ConnPoolControl<T>public String toString()
ObjecttoString method returns a
string that "textually represents" this object. The result should be a concise but informative
representation that is easy for a person to read. It is recommended that all subclasses override
this method.
The toString method for class Object returns a string consisting of the name of
the class of which the object is an instance, the at-sign character `@', and the unsigned
hexadecimal representation of the hash code of the object. In other words, this method returns a
string equal to the value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public void validatePendingRequests()