org.apache.http.impl.conn

## Class DefaultManagedHttpClientConnection

- java.lang.Object
- - org.apache.http.impl.BHttpConnectionBase
  - - org.apache.http.impl.DefaultBHttpClientConnection
    - - org.apache.http.impl.conn.DefaultManagedHttpClientConnection

- All Implemented Interfaces:
    Closeable ， AutoCloseable ， ManagedHttpClientConnection ， HttpClientConnection ， HttpConnection ， HttpInetConnection ， HttpContext

      public class DefaultManagedHttpClientConnection
      extends DefaultBHttpClientConnection
      implements ManagedHttpClientConnection, HttpContext

  默认`ManagedHttpClientConnection`实现。
  从以下版本开始：
    4.3

- - ### Field Summary

    - ### Fields inherited from interface org.apache.http.protocol.HttpContext

      `RESERVED_PREFIX`

  - ### 构造方法摘要

    构造方法
    Constructor and Description
    `DefaultManagedHttpClientConnection(String id, int buffersize)`
    `DefaultManagedHttpClientConnection(String id, int buffersize, int fragmentSizeHint, CharsetDecoder chardecoder, CharsetEncoder charencoder, MessageConstraints constraints, ContentLengthStrategy incomingContentStrategy, ContentLengthStrategy outgoingContentStrategy, HttpMessageWriterFactory<HttpRequest> requestWriterFactory, HttpMessageParserFactory<HttpResponse> responseParserFactory)`

  - ### 方法摘要

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `bind(Socket socket)` 将此连接绑定到给定的套接字。
    `Object` | `getAttribute(String id)`
    `String` | `getId()` 返回连接管理器的使用寿命期望为唯一的连接ID。
    `Socket` | `getSocket()` 返回底层socket。
    `SSLSession` | `getSSLSession()` 获取底层连接的SSL会话（如果有）。
    `Object` | `removeAttribute(String id)`
    `void` | `setAttribute(String id, Object obj)`
    `void` | `shutdown()`

    - ### Methods inherited from class org.apache.http.impl.DefaultBHttpClientConnection

      `flush, isResponseAvailable, onRequestSubmitted, onResponseReceived, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader`

    - ### Methods inherited from class org.apache.http.impl.BHttpConnectionBase

      `awaitInput, close, createInputStream, createOutputStream, doFlush, ensureOpen, getLocalAddress, getLocalPort, getMetrics, getRemoteAddress, getRemotePort, getSessionInputBuffer, getSessionOutputBuffer, getSocketInputStream, getSocketOutputStream, getSocketTimeout, incrementRequestCount, incrementResponseCount, isOpen, isStale, prepareInput, prepareOutput, setSocketTimeout, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.http.HttpClientConnection

      `flush, isResponseAvailable, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader`

    - ### Methods inherited from interface org.apache.http.HttpInetConnection

      `getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort`

    - ### Methods inherited from interface org.apache.http.HttpConnection

      `close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout`

- - ### 构造方法详细信息

    - #### DefaultManagedHttpClientConnection

          public DefaultManagedHttpClientConnection(String id,
                                            int buffersize,
                                            int fragmentSizeHint,
                                            CharsetDecoder chardecoder,
                                            CharsetEncoder charencoder,
                                            MessageConstraints constraints,
                                            ContentLengthStrategy incomingContentStrategy,
                                            ContentLengthStrategy outgoingContentStrategy,
                                            HttpMessageWriterFactory<HttpRequest> requestWriterFactory,
                                            HttpMessageParserFactory<HttpResponse> responseParserFactory)

    - #### DefaultManagedHttpClientConnection

          public DefaultManagedHttpClientConnection(String id,
                                            int buffersize)

  - ### 方法详细信息

    - #### getId

          public String getId()

      说明从界面： `ManagedHttpClientConnection`复制
      返回连接管理器的使用寿命期望为唯一的连接ID。
      Specified by:
        `getId`在界面 `ManagedHttpClientConnection`

    - #### shutdown

          public void shutdown()
                        throws IOException

      Specified by:
        `shutdown`在界面 `HttpConnection`
      重写：
        `shutdown`在 `BHttpConnectionBase`
      异常
        `IOException`

    - #### getAttribute

          public Object getAttribute(String id)

      Specified by:
        `getAttribute`在界面 `HttpContext`

    - #### removeAttribute

          public Object removeAttribute(String id)

      Specified by:
        `removeAttribute`在界面 `HttpContext`

    - #### setAttribute

          public void setAttribute(String id,
                          Object obj)

      Specified by:
        `setAttribute`在界面 `HttpContext`

    - #### bind

          public void bind(Socket socket)
                    throws IOException

      说明从界面： `ManagedHttpClientConnection`复制
      将此连接绑定到给定的套接字。 如果连接被绑定并且底层套接字连接到远程主机，则该连接被视为已打开。
      Specified by:
        `bind`在界面 `ManagedHttpClientConnection`
      重写：
        `bind`在类 `DefaultBHttpClientConnection`
      参数
        `socket` - 将连接绑定到的套接字。
      异常
        `IOException`

    - #### getSocket

          public Socket getSocket()

      说明从界面： `ManagedHttpClientConnection`复制
      返回底层socket。
      Specified by:
        `getSocket`在界面 `ManagedHttpClientConnection`
      重写：
        `getSocket`在 `BHttpConnectionBase`

    - #### getSSLSession

          public SSLSession getSSLSession()

      说明从界面： `ManagedHttpClientConnection`复制
      获取底层连接的SSL会话（如果有）。 如果此连接已打开，并且底层套接字为`SSLSocket` ，则会获取该套接字的SSL会话。 这是一个潜在的阻塞操作。
      Specified by:
        `getSSLSession`在接口 `ManagedHttpClientConnection`
      结果
        底层SSL会话（如果可用），否则为 `null`

Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.

本帮助文档是使用 《谷歌翻译》翻译，请与英文版配合使用 by--QQ:654638585