T - routeC - connection object@Contract(threading=SAFE) @Experimental public class LaxConnPool<T,C extends ModalCloseable> extends Object implements ManagedConnPool<T,C>
| 构造器和说明 |
|---|
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) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
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() |
void |
validatePendingRequests() |
public LaxConnPool(int defaultMaxPerRoute,
TimeValue timeToLive,
PoolReusePolicy policy,
DisposalCallback<C> disposalCallback,
ConnPoolListener<T> connPoolListener)
public LaxConnPool(int defaultMaxPerRoute,
TimeValue timeToLive,
PoolReusePolicy policy,
ConnPoolListener<T> connPoolListener)
public LaxConnPool(int defaultMaxPerRoute)
public boolean isShutdown()
public void close(CloseMode closeMode)
ModalCloseableclose 在接口中 ModalCloseablecloseMode - How to close the receiver.public void close()
close 在接口中 Closeableclose 在接口中 AutoCloseablepublic Future<PoolEntry<T,C>> lease(T route, Object state, Timeout requestTimeout, FutureCallback<PoolEntry<T,C>> callback)
ConnPoolPlease note the connection request can get automatically cancelled by the pool in case of a request timeout.
lease 在接口中 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. In case of a timeout the request
can get automatically cancelled by the pool.callback - operation completion callback.public void release(PoolEntry<T,C> entry, boolean reusable)
ConnPoolrelease 在接口中 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 validatePendingRequests()
public void setMaxTotal(int max)
setMaxTotal 在接口中 ConnPoolControl<T>public int getMaxTotal()
getMaxTotal 在接口中 ConnPoolControl<T>public void setDefaultMaxPerRoute(int max)
setDefaultMaxPerRoute 在接口中 ConnPoolControl<T>public int getDefaultMaxPerRoute()
getDefaultMaxPerRoute 在接口中 ConnPoolControl<T>public void setMaxPerRoute(T route, int max)
setMaxPerRoute 在接口中 ConnPoolControl<T>public int getMaxPerRoute(T route)
getMaxPerRoute 在接口中 ConnPoolControl<T>public PoolStats getTotalStats()
getTotalStats 在接口中 ConnPoolStats<T>public PoolStats getStats(T route)
getStats 在接口中 ConnPoolStats<T>public Set<T> getRoutes()
getRoutes 在接口中 ConnPoolControl<T>public void closeIdle(TimeValue idleTime)
closeIdle 在接口中 ConnPoolControl<T>public void closeExpired()
closeExpired 在接口中 ConnPoolControl<T>Copyright © 2023. All rights reserved.