@Deprecated public abstract class AbstractClientConnAdapter extends Object implements ManagedClientConnection, HttpContext
operated到managed客户端连接。
读写方法被委派给包装的连接。
影响连接状态的操作必须由派生类实现。
如果有一个连接状态,查询连接状态的操作将被委托给包装的连接,否则返回默认值。
该适配器可跟踪可重复使用的通信状态的检查站,以指示markReusable ,并通过查询isMarkedReusable 。 所有发送和接收操作将自动清除该标记。
连接释放呼叫被委派给连接管理器,如果有的话。 abortConnection将首先清除可重用性标记。 连接管理器应该容忍对释放方法的多次调用。
RESERVED_PREFIX| Modifier | Constructor and Description |
|---|---|
protected |
AbstractClientConnAdapter(ClientConnectionManager mgr, OperatedClientConnection conn)
已过时。
创建一个新的连接适配器。
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortConnection()
已过时。
释放连接而不选择保持活动。
|
protected void |
assertNotAborted()
已过时。
|
protected void |
assertValid(OperatedClientConnection wrappedConn)
已过时。
断言有一个有效的包装连接来委托。
|
void |
bind(Socket socket)
已过时。
将此连接绑定到给定的套接字。
|
protected void |
detach()
已过时。
从包装的连接中分离此适配器。
|
void |
flush()
已过时。
|
Object |
getAttribute(String id)
已过时。
|
InetAddress |
getLocalAddress()
已过时。
|
int |
getLocalPort()
已过时。
|
protected ClientConnectionManager |
getManager()
已过时。
|
HttpConnectionMetrics |
getMetrics()
已过时。
|
InetAddress |
getRemoteAddress()
已过时。
|
int |
getRemotePort()
已过时。
|
Socket |
getSocket()
已过时。
返回底层socket。
|
int |
getSocketTimeout()
已过时。
|
SSLSession |
getSSLSession()
已过时。
获取底层连接的SSL会话(如果有)。
|
protected OperatedClientConnection |
getWrappedConnection()
已过时。
|
boolean |
isMarkedReusable()
已过时。
指示此连接是否处于可重用的通信状态。
|
boolean |
isOpen()
已过时。
|
protected boolean |
isReleased()
已过时。
|
boolean |
isResponseAvailable(int timeout)
已过时。
|
boolean |
isSecure()
已过时。
指示此连接是否安全。
|
boolean |
isStale()
已过时。
|
void |
markReusable()
已过时。
将此连接标记为处于可重用的通信状态。
|
void |
receiveResponseEntity(HttpResponse response)
已过时。
|
HttpResponse |
receiveResponseHeader()
已过时。
|
void |
releaseConnection()
已过时。
释放与keep-alive选项的连接。
|
Object |
removeAttribute(String id)
已过时。
|
void |
sendRequestEntity(HttpEntityEnclosingRequest request)
已过时。
|
void |
sendRequestHeader(HttpRequest request)
已过时。
|
void |
setAttribute(String id, Object obj)
已过时。
|
void |
setIdleDuration(long duration, TimeUnit unit)
已过时。
设置此连接在重新使用之前可以保持空闲的持续时间。
|
void |
setSocketTimeout(int timeout)
已过时。
|
void |
unmarkReusable()
已过时。
将此连接标记为不处于可重用状态。
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRoute, getState, layerProtocol, open, setState, tunnelProxy, tunnelTargetgetIdclose, shutdownprotected AbstractClientConnAdapter(ClientConnectionManager mgr, OperatedClientConnection conn)
marked作为可重用的。
mgr - 连接管理器,或
null
conn - 连接到wrap,或
null
protected void detach()
protected OperatedClientConnection getWrappedConnection()
protected ClientConnectionManager getManager()
@Deprecated protected final void assertNotAborted() throws InterruptedIOException
assertValid(OperatedClientConnection)
protected boolean isReleased()
protected final void assertValid(OperatedClientConnection wrappedConn) throws ConnectionShutdownException
ConnectionShutdownException - 如果没有中断连接或连接
public boolean isOpen()
isOpen在接口
HttpConnection
public boolean isStale()
isStale在接口
HttpConnection
public void setSocketTimeout(int timeout)
setSocketTimeout在接口
HttpConnection
public int getSocketTimeout()
getSocketTimeout在接口
HttpConnection
public HttpConnectionMetrics getMetrics()
getMetrics在接口
HttpConnection
public void flush()
throws IOException
flush在接口
HttpClientConnection
IOException
public boolean isResponseAvailable(int timeout)
throws IOException
isResponseAvailable在接口
HttpClientConnection
IOException
public void receiveResponseEntity(HttpResponse response) throws HttpException, IOException
receiveResponseEntity在接口
HttpClientConnection
HttpException
IOException
public HttpResponse receiveResponseHeader() throws HttpException, IOException
receiveResponseHeader在接口
HttpClientConnection
HttpException
IOException
public void sendRequestEntity(HttpEntityEnclosingRequest request) throws HttpException, IOException
sendRequestEntity在接口
HttpClientConnection
HttpException
IOException
public void sendRequestHeader(HttpRequest request) throws HttpException, IOException
sendRequestHeader在接口
HttpClientConnection
HttpException
IOException
public InetAddress getLocalAddress()
getLocalAddress在接口
HttpInetConnection
public int getLocalPort()
getLocalPort在接口
HttpInetConnection
public InetAddress getRemoteAddress()
getRemoteAddress在接口
HttpInetConnection
public int getRemotePort()
getRemotePort在接口
HttpInetConnection
public boolean isSecure()
ManagedClientConnection复制
isSecure在接口
HttpRoutedConnection
isSecure在接口
ManagedClientConnection
true如果这个连接是安全的,
false否则
public void bind(Socket socket) throws IOException
ManagedHttpClientConnection复制
bind在接口
ManagedHttpClientConnection
socket - 将连接绑定到的套接字。
IOException
public Socket getSocket()
ManagedHttpClientConnection复制
getSocket在接口
ManagedHttpClientConnection
public SSLSession getSSLSession()
ManagedClientConnection复制
SSLSocket ,则会获取该套接字的SSL会话。
这是一个潜在的阻塞操作。
注意:底层套接字是否为SSL套接字不一定可以通过ManagedClientConnection.isSecure()确定。 普通插座可能被认为是安全的,例如,如果它们连接到同一网段中的已知主机。 另一方面,SSL套接字可能被认为是不安全的,例如根据所选择的加密套件。
getSSLSession在接口
HttpRoutedConnection
getSSLSession在接口
ManagedClientConnection
getSSLSession在接口
ManagedHttpClientConnection
null否则
public void markReusable()
ManagedClientConnection复制
可重用的通信状态是必需的,但不足以使连接被重用。 A route不匹配,正在关闭的连接或其他情况可能会阻止重用。
markReusable在接口
ManagedClientConnection
public void unmarkReusable()
ManagedClientConnection复制
reuse strategy的评估。
注:这是没有必要写或从该连接读取数据前来电来访。 通信尝试将自动将状态标记为不可重用。 然后可以使用markReusable切换回来。
unmarkReusable在接口
ManagedClientConnection
public boolean isMarkedReusable()
ManagedClientConnection复制
markReusable和unmarkReusable 。
isMarkedReusable在接口
ManagedClientConnection
true如果此连接被标记为处于可重用的通信状态,
false否则
public void setIdleDuration(long duration,
TimeUnit unit)
ManagedClientConnection复制
setIdleDuration在接口
ManagedClientConnection
public void releaseConnection()
ConnectionReleaseTrigger复制
releaseConnection在接口
ConnectionReleaseTrigger
public void abortConnection()
ConnectionReleaseTrigger复制
abortConnection在接口
ConnectionReleaseTrigger
public Object getAttribute(String id)
getAttribute在接口
HttpContext
public Object removeAttribute(String id)
removeAttribute在接口
HttpContext
public void setAttribute(String id, Object obj)
setAttribute在接口
HttpContext
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.