Package org.apache.http.conn
Class BasicManagedEntity
java.lang.Object
org.apache.http.entity.HttpEntityWrapper
org.apache.http.conn.BasicManagedEntity
- All Implemented Interfaces:
ConnectionReleaseTrigger,EofSensorWatcher,org.apache.http.HttpEntity
@Deprecated
public class BasicManagedEntity
extends org.apache.http.entity.HttpEntityWrapper
implements ConnectionReleaseTrigger, EofSensorWatcher
Deprecated.
(4.3) do not use.
An entity that releases a
connection.
A ManagedClientConnection will
typically not return a managed entity, but you can replace
the unmanaged entity in the response with a managed one.- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanDeprecated.Whether to keep the connection alive.protected ManagedClientConnectionDeprecated.The connection to release.Fields inherited from class org.apache.http.entity.HttpEntityWrapper
wrappedEntity -
Constructor Summary
ConstructorsConstructorDescriptionBasicManagedEntity(org.apache.http.HttpEntity entity, ManagedClientConnection conn, boolean reuse) Deprecated.Creates a new managed entity that can release a connection. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Releases the connection without the option of keep-alive.voidDeprecated.(4.1) UseEntityUtils.consume(HttpEntity)private voidDeprecated.booleaneofDetected(InputStream wrapped) Deprecated.Indicates that EOF is detected.Deprecated.booleanDeprecated.voidDeprecated.Releases the connection with the option of keep-alive.protected voidDeprecated.Releases the connection gracefully.booleanstreamAbort(InputStream wrapped) Deprecated.Indicates that thestreamis aborted.booleanstreamClosed(InputStream wrapped) Deprecated.Indicates that thestreamis closed.voidwriteTo(OutputStream outStream) Deprecated.Methods inherited from class org.apache.http.entity.HttpEntityWrapper
getContentEncoding, getContentLength, getContentType, isChunked, isStreaming
-
Field Details
-
managedConn
Deprecated.The connection to release. -
attemptReuse
protected final boolean attemptReuseDeprecated.Whether to keep the connection alive.
-
-
Constructor Details
-
BasicManagedEntity
public BasicManagedEntity(org.apache.http.HttpEntity entity, ManagedClientConnection conn, boolean reuse) Deprecated.Creates a new managed entity that can release a connection.- Parameters:
entity- 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.conn- the connection to releasereuse- whether the connection should be re-used
-
-
Method Details
-
isRepeatable
public boolean isRepeatable()Deprecated.- Specified by:
isRepeatablein interfaceorg.apache.http.HttpEntity- Overrides:
isRepeatablein classorg.apache.http.entity.HttpEntityWrapper
-
getContent
Deprecated.- Specified by:
getContentin interfaceorg.apache.http.HttpEntity- Overrides:
getContentin classorg.apache.http.entity.HttpEntityWrapper- Throws:
IOException
-
ensureConsumed
Deprecated.- Throws:
IOException
-
consumeContent
Deprecated.(4.1) UseEntityUtils.consume(HttpEntity)- Specified by:
consumeContentin interfaceorg.apache.http.HttpEntity- Overrides:
consumeContentin classorg.apache.http.entity.HttpEntityWrapper- Throws:
IOException
-
writeTo
Deprecated.- Specified by:
writeToin interfaceorg.apache.http.HttpEntity- Overrides:
writeToin classorg.apache.http.entity.HttpEntityWrapper- Throws:
IOException
-
releaseConnection
Deprecated.Description copied from interface:ConnectionReleaseTriggerReleases 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. UseabortConnectionfor a hard release. The connection may be reused as specified by the duration.- Specified by:
releaseConnectionin interfaceConnectionReleaseTrigger- Throws:
IOException- in case of an IO problem. The connection will be released anyway.
-
abortConnection
Deprecated.Description copied from interface:ConnectionReleaseTriggerReleases the connection without the option of keep-alive. This is a "hard" release that implies a shutdown of the connection. UseConnectionReleaseTrigger.releaseConnection()for a graceful release.- Specified by:
abortConnectionin interfaceConnectionReleaseTrigger- Throws:
IOException- in case of an IO problem. The connection will be released anyway.
-
eofDetected
Deprecated.Description copied from interface:EofSensorWatcherIndicates that EOF is detected.- Specified by:
eofDetectedin interfaceEofSensorWatcher- Parameters:
wrapped- the underlying stream which has reached EOF- Returns:
trueifwrappedshould be closed,falseif it should be left alone- Throws:
IOException- in case of an IO problem, for example if the watcher itself closes the underlying stream. The caller will leave the wrapped stream alone, as iffalsewas returned.
-
streamClosed
Deprecated.Description copied from interface:EofSensorWatcherIndicates that thestreamis closed. This method will be called only if EOF was not detected before closing. Otherwise,eofDetectedis called.- Specified by:
streamClosedin interfaceEofSensorWatcher- Parameters:
wrapped- the underlying stream which has not reached EOF- Returns:
trueifwrappedshould be closed,falseif it should be left alone- Throws:
IOException- in case of an IO problem, for example if the watcher itself closes the underlying stream. The caller will leave the wrapped stream alone, as iffalsewas returned.
-
streamAbort
Deprecated.Description copied from interface:EofSensorWatcherIndicates that thestreamis aborted. This method will be called only if EOF was not detected before aborting. Otherwise,eofDetectedis called.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.
- Specified by:
streamAbortin interfaceEofSensorWatcher- Parameters:
wrapped- the underlying stream which has not reached EOF- Returns:
trueifwrappedshould be closed,falseif it should be left alone- Throws:
IOException- in case of an IO problem, for example if the watcher itself closes the underlying stream. The caller will leave the wrapped stream alone, as iffalsewas returned.
-
releaseManagedConnection
Deprecated.Releases the connection gracefully. The connection attribute will be nullified. Subsequent invocations are no-ops.- Throws:
IOException- in case of an IO problem. The connection attribute will be nullified anyway.
-