Connection header will
be examined. In the absence of a Connection header, the
non-standard but commonly used Proxy-Connection header takes
it's role. A token close indicates that the connection cannot
be reused. If there is no such token, a token keep-alive
indicates that the connection should be re-used. If neither token is found,
or if there are no Connection headers, the default policy for
the HTTP version is applied. Since HTTP/1.1, connections are
re-used by default. Up until HTTP/1.0, connections are not
re-used by default.
| Modifier and Type | Field and Description |
|---|---|
| public static final DefaultConnectionReuseStrategy |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| protected TokenIterator | Returns: the token iteratorthe header iterator hit)Creates a token iterator from a header iterator. |
| public boolean | keepAlive(final HttpResponse
The last response received over that connection. response, final HttpContext the context in which the connection is being
used. context)Implements org. |
| INSTANCE | back to summary |
|---|---|
| public static final DefaultConnectionReuseStrategy INSTANCE | |
| DefaultConnectionReuseStrategy | back to summary |
|---|---|
| public DefaultConnectionReuseStrategy() | |
| canResponseHaveBody | back to summary |
|---|---|
| private boolean canResponseHaveBody(final HttpRequest request, final HttpResponse response) | |
| createTokenIterator | back to summary |
|---|---|
| protected TokenIterator createTokenIterator(final HeaderIterator hit) Creates a token iterator from a header iterator. This method can be overridden to replace the implementation of the token iterator.
| |
| keepAlive | back to summary |
|---|---|
| public boolean keepAlive(final HttpResponse response, final HttpContext context) Implements org. Doc from org. Decides whether a connection can be kept open after a request.
If this method returns One can use the HTTP context to retrieve additional objects that may be relevant for the keep-alive strategy: the actual HTTP connection, the original HTTP request, target host if known, number of times the connection has been reused already and so on.
If the connection is already closed,
| |