Deprecated
(4.3) do not use.
connection.
A ManagedClientConnection will
typically not return a managed entity, but you can replace
the unmanaged entity in the response with a managed one.
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | attemptReuse
Whether to keep the connection alive. |
| protected ManagedClientConnection | managedConn
The connection to release. |
| Access | Constructor and Description |
|---|---|
| public | BasicManagedEntity(final HttpEntity
the entity of which to wrap the content.
Note that the argument entity can no longer be used
afterwards, since the content will be taken by this
managed entity. entity, final ManagedClientConnection the connection to release conn, final boolean whether the connection should be re-used reuse)
Deprecated
as a consequence of
Creates a new managed entity that can release a connection.
ManagedClientConnection being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | abortConnection()
Implements org. |
| public void | consumeContent()
Overrides org. Implements org.
Deprecated
(4.1) Use
This method is deprecated since version 4.1.
EntityUtils#consume(HttpEntity)
|
| private void | |
| public boolean | eofDetected(final InputStream
the underlying stream which has reached EOF wrapped)Implements org. |
| public InputStream | getContent()
Overrides org. Implements org. |
| public boolean | isRepeatable()
Overrides org. Implements org. |
| public void | releaseConnection()
Implements org. |
| protected void | |
| public boolean | streamAbort(final InputStream
the underlying stream which has not reached EOF wrapped)Implements org. stream is aborted.
|
| public boolean | streamClosed(final InputStream
the underlying stream which has not reached EOF wrapped)Implements org. stream is closed.
|
| public void | writeTo(final OutputStream
the output stream to write entity content to outStream)Overrides org. Implements org. |
| attemptReuse | back to summary |
|---|---|
| protected final boolean attemptReuse Whether to keep the connection alive. | |
| managedConn | back to summary |
|---|---|
| protected ManagedClientConnection managedConn
Deprecated as a consequence of The connection to release. | |
| BasicManagedEntity | back to summary |
|---|---|
| public BasicManagedEntity(final HttpEntity entity, final ManagedClientConnection conn, final boolean reuse)
Deprecated as a consequence of Creates a new managed entity that can release a connection.
| |
| abortConnection | back to summary |
|---|---|
| public void abortConnection() throws IOException Implements org. Doc from org. Releases the connection without the option of keep-alive.
This is a "hard" release that implies a shutdown of the connection.
Use
| |
| consumeContent | back to summary |
|---|---|
| public void consumeContent() throws IOException Overrides org. Implements org. Doc from org. Deprecated (4.1) Use This method is deprecated since version 4.1. Please use standard
java convention to ensure resource deallocation by calling
This method is called to indicate that the content of this entity is no longer required. All entity implementations are expected to release all allocated resources as a result of this method invocation. Content streaming entities are also expected to dispose of the remaining content, if any. Wrapping entities should delegate this call to the wrapped entity.
This method is of particular importance for entities being
received from a
| |
| ensureConsumed | back to summary |
|---|---|
| private void ensureConsumed() throws IOException | |
| eofDetected | back to summary |
|---|---|
| public boolean eofDetected(final InputStream wrapped) throws IOException Implements org. Doc from org. Indicates that EOF is detected.
| |
| getContent | back to summary |
|---|---|
| public InputStream getContent() throws IOException Overrides org. Implements org. Doc from org. Returns a content stream of the entity.
Important Note Please note all entity implementations must ensure that
all allocated resources are properly deallocated after
the
| |
| isRepeatable | back to summary |
|---|---|
| public boolean isRepeatable() Overrides org. Implements org. Doc from org. Tells if the entity is capable of producing its data more than once. A repeatable entity's getContent() and writeTo(OutputStream) methods can be called more than once whereas a non-repeatable entity's can not.
| |
| releaseConnection | back to summary |
|---|---|
| public void releaseConnection() throws IOException Implements org. Doc from org. Releases the connection with the option of keep-alive. This is a
"graceful" release and may cause IO operations for consuming the
remainder of a response entity. Use
| |
| releaseManagedConnection | back to summary |
|---|---|
| protected void releaseManagedConnection() throws IOException Releases the connection gracefully. The connection attribute will be nullified. Subsequent invocations are no-ops.
| |
| streamAbort | back to summary |
|---|---|
| public boolean streamAbort(final InputStream wrapped) throws IOException Implements org. Doc from org. Indicates that the This method will also be invoked when an input operation causes an IOException to be thrown to make sure the input stream gets shut down.
| |
| streamClosed | back to summary |
|---|---|
| public boolean streamClosed(final InputStream wrapped) throws IOException Implements org. Doc from org. Indicates that the
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(final OutputStream outStream) throws IOException Overrides org. Implements org. Doc from org. Writes the entity content out to the output stream. Important Note Please note all entity implementations must ensure that all allocated resources are properly deallocated when this method returns.
| |