Top Description Fields Constructors Methods
org.apache.http.conn

public Class BasicEofSensorWatcher

extends Object
implements EofSensorWatcher
Class Inheritance
All Implemented Interfaces
org.apache.http.conn.EofSensorWatcher
Annotations
@Deprecated
Imports
java.io.IOException, .InputStream, org.apache.http.util.Args

Deprecated

(4.3) do not use.

Basic implementation of EofSensorWatcher. The underlying connection is released on close or EOF.
Since
4.0

Field Summary

Modifier and TypeField and Description
protected final boolean
attemptReuse

Whether to keep the connection alive.

protected final ManagedClientConnection
managedConn

The connection to auto-release.

Constructor Summary

AccessConstructor and Description
public
BasicEofSensorWatcher(final ManagedClientConnection
the connection to auto-release
conn
,
final boolean
whether the connection should be re-used
reuse
)

Deprecated as a consequence of ManagedClientConnection being deprecated.
Creates a new watcher for auto-releasing a connection.

Method Summary

Modifier and TypeMethod and Description
public boolean
eofDetected(final InputStream
the underlying stream which has reached EOF
wrapped
)

Implements org.apache.http.conn.EofSensorWatcher.eofDetected.

Indicates that EOF is detected.
public boolean
streamAbort(final InputStream
the underlying stream which has not reached EOF
wrapped
)

Implements org.apache.http.conn.EofSensorWatcher.streamAbort.

Indicates that the stream is aborted.
public boolean
streamClosed(final InputStream
the underlying stream which has not reached EOF
wrapped
)

Implements org.apache.http.conn.EofSensorWatcher.streamClosed.

Indicates that the stream is closed.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attemptReuseback to summary
protected final boolean attemptReuse

Whether to keep the connection alive.

managedConnback to summary
protected final ManagedClientConnection managedConn

Deprecated

as a consequence of ManagedClientConnection being deprecated. See corresponding docs for further information.

The connection to auto-release.

Constructor Detail

BasicEofSensorWatcherback to summary
public BasicEofSensorWatcher(final ManagedClientConnection conn, final boolean reuse)

Deprecated

as a consequence of ManagedClientConnection being deprecated. See corresponding docs for further information.

Creates a new watcher for auto-releasing a connection.

Parameters
conn:ManagedClientConnection

the connection to auto-release

reuse:boolean

whether the connection should be re-used

Method Detail

eofDetectedback to summary
public boolean eofDetected(final InputStream wrapped) throws IOException

Implements org.apache.http.conn.EofSensorWatcher.eofDetected.

Doc from org.apache.http.conn.EofSensorWatcher.eofDetected.

Indicates that EOF is detected.

Parameters
wrapped:InputStream

the underlying stream which has reached EOF

Returns:boolean

true if wrapped should be closed, false if it should be left alone

Annotations
@Override
Exceptions
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 if false was returned.
streamAbortback to summary
public boolean streamAbort(final InputStream wrapped) throws IOException

Implements org.apache.http.conn.EofSensorWatcher.streamAbort.

Doc from org.apache.http.conn.EofSensorWatcher.streamAbort.

Indicates that the stream 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.

Parameters
wrapped:InputStream

the underlying stream which has not reached EOF

Returns:boolean

true if wrapped should be closed, false if it should be left alone

Annotations
@Override
Exceptions
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 if false was returned.
streamClosedback to summary
public boolean streamClosed(final InputStream wrapped) throws IOException

Implements org.apache.http.conn.EofSensorWatcher.streamClosed.

Doc from org.apache.http.conn.EofSensorWatcher.streamClosed.

Indicates that the stream is closed. This method will be called only if EOF was not detected before closing. Otherwise, eofDetected is called.

Parameters
wrapped:InputStream

the underlying stream which has not reached EOF

Returns:boolean

true if wrapped should be closed, false if it should be left alone

Annotations
@Override
Exceptions
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 if false was returned.