AbstractConnPool
@Deprecated public abstract class AbstractConnPool extends Object
| Modifier and Type | Field and Description |
|---|---|
protected IdleConnectionHandler |
idleConnHandler
已过时。
|
protected boolean |
isShutDown
已过时。
指示此池是否关闭。
|
protected Set<BasicPoolEntryRef> |
issuedConnections
已过时。
|
protected Set<BasicPoolEntry> |
leasedConnections
已过时。
|
protected int |
numConnections
已过时。
|
protected Lock |
poolLock
已过时。
这个池的全局锁。
|
protected ReferenceQueue<Object> |
refQueue
已过时。
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConnPool()
已过时。
创建一个新的连接池。
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeConnection(OperatedClientConnection conn)
已过时。
关闭此池的连接。
|
void |
closeExpiredConnections()
已过时。
|
void |
closeIdleConnections(long idletime, TimeUnit tunit)
已过时。
关闭空闲连接。
|
abstract void |
deleteClosedConnections()
已过时。
删除所有连接关闭的条目。
|
void |
enableConnectionGC()
已过时。
|
abstract void |
freeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, TimeUnit timeUnit)
已过时。
返回到池中的条目。
|
BasicPoolEntry |
getEntry(HttpRoute route, Object state, long timeout, TimeUnit tunit)
已过时。
在给定的超时内获取连接的池条目。
|
protected abstract void |
handleLostEntry(HttpRoute route)
已过时。
|
void |
handleReference(Reference<?> ref)
已过时。
|
abstract PoolEntryRequest |
requestPoolEntry(HttpRoute route, Object state)
已过时。
返回一个新的 PoolEntryRequest ,从中可以获得BasicPoolEntry ,或者请求可以中止。
|
void |
shutdown()
已过时。
关闭此池和所有相关资源。
|
protected final Lock poolLock
protected Set<BasicPoolEntry> leasedConnections
protected int numConnections
protected volatile boolean isShutDown
protected Set<BasicPoolEntryRef> issuedConnections
protected ReferenceQueue<Object> refQueue
protected IdleConnectionHandler idleConnHandler
public void enableConnectionGC()
throws IllegalStateException
public final BasicPoolEntry getEntry(HttpRoute route, Object state, long timeout, TimeUnit tunit) throws ConnectionPoolTimeoutException, InterruptedException
route - 获取连接的路由
state - 状态
timeout - 超时,0或否定超时
tunit -为对所述单元
timeout ,可以是
null只有如果没有超时
ConnectionPoolTimeoutException - 如果超时过期
InterruptedException - 如果调用线程中断
public abstract PoolEntryRequest requestPoolEntry(HttpRoute route, Object state)
PoolEntryRequest ,从中可以获得BasicPoolEntry ,或者请求可以中止。
route - 路线
state - 状态
public abstract void freeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, TimeUnit timeUnit)
entry - 连接释放的条目
reusable -
true如果条目被视为可重用,
false否则。
validDuration - 条目应保持自由和可重用的持续时间。
timeUnit - 测量持续时间的单位。
public void handleReference(Reference<?> ref)
protected abstract void handleLostEntry(HttpRoute route)
public void closeIdleConnections(long idletime,
TimeUnit tunit)
idletime - 连接应该空闲的时间,以便现在关闭
tunit - 单位为
idletime
public void closeExpiredConnections()
public abstract void deleteClosedConnections()
public void shutdown()
protected void closeConnection(OperatedClientConnection conn)
conn - 连接关闭,或
null
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.