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 boolean
Deprecated.Whether to keep the connection alive.protected ManagedClientConnection
Deprecated.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 TypeMethodDescriptionvoid
Deprecated.Releases the connection without the option of keep-alive.void
Deprecated.(4.1) UseEntityUtils.consume(HttpEntity)
boolean
eofDetected
(InputStream wrapped) Deprecated.Indicates that EOF is detected.Deprecated.boolean
Deprecated.void
Deprecated.Releases the connection with the option of keep-alive.protected void
Deprecated.Releases the connection gracefully.boolean
streamAbort
(InputStream wrapped) Deprecated.Indicates that thestream
is aborted.boolean
streamClosed
(InputStream wrapped) Deprecated.Indicates that thestream
is closed.void
writeTo
(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:
isRepeatable
in interfaceorg.apache.http.HttpEntity
- Overrides:
isRepeatable
in classorg.apache.http.entity.HttpEntityWrapper
-
getContent
Deprecated.- Specified by:
getContent
in interfaceorg.apache.http.HttpEntity
- Overrides:
getContent
in classorg.apache.http.entity.HttpEntityWrapper
- Throws:
IOException
-
consumeContent
Deprecated.(4.1) UseEntityUtils.consume(HttpEntity)
- Specified by:
consumeContent
in interfaceorg.apache.http.HttpEntity
- Overrides:
consumeContent
in classorg.apache.http.entity.HttpEntityWrapper
- Throws:
IOException
-
writeTo
Deprecated.- Specified by:
writeTo
in interfaceorg.apache.http.HttpEntity
- Overrides:
writeTo
in classorg.apache.http.entity.HttpEntityWrapper
- Throws:
IOException
-
releaseConnection
Deprecated.Description copied from interface:ConnectionReleaseTrigger
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. UseabortConnection
for a hard release. The connection may be reused as specified by the duration.- Specified by:
releaseConnection
in interfaceConnectionReleaseTrigger
- Throws:
IOException
- in case of an IO problem. The connection will be released anyway.
-
abortConnection
Deprecated.Description copied from interface:ConnectionReleaseTrigger
Releases 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:
abortConnection
in interfaceConnectionReleaseTrigger
- Throws:
IOException
- in case of an IO problem. The connection will be released anyway.
-
eofDetected
Deprecated.Description copied from interface:EofSensorWatcher
Indicates that EOF is detected.- Specified by:
eofDetected
in interfaceEofSensorWatcher
- Parameters:
wrapped
- the underlying stream which has reached EOF- Returns:
true
ifwrapped
should be closed,false
if 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 iffalse
was returned.
-
streamClosed
Deprecated.Description copied from interface:EofSensorWatcher
Indicates that thestream
is closed. This method will be called only if EOF was not detected before closing. Otherwise,eofDetected
is called.- Specified by:
streamClosed
in interfaceEofSensorWatcher
- Parameters:
wrapped
- the underlying stream which has not reached EOF- Returns:
true
ifwrapped
should be closed,false
if 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 iffalse
was returned.
-
streamAbort
Deprecated.Description copied from interface:EofSensorWatcher
Indicates that thestream
is aborted. This method will be called only if EOF was not detected before aborting. Otherwise,eofDetected
is 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:
streamAbort
in interfaceEofSensorWatcher
- Parameters:
wrapped
- the underlying stream which has not reached EOF- Returns:
true
ifwrapped
should be closed,false
if 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 iffalse
was 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.
-