Top Description Methods
org.apache.http.conn

public Interface ConnectionReleaseTrigger

Known Direct Subinterfaces
org.apache.http.conn.ManagedClientConnection
Known Direct Implementers
org.apache.http.conn.EofSensorInputStream, org.apache.http.impl.execchain.ConnectionHolder, org.apache.http.conn.BasicManagedEntity
Imports
java.io.IOException

Interface for releasing a connection. This can be implemented by various "trigger" objects which are associated with a connection, for example a EofSensorInputStream or the ManagedHttpClientConnection itself.

The methods in this interface can safely be called multiple times. The first invocation releases the connection, subsequent calls are ignored.

Since
4.0

Method Summary

Modifier and TypeMethod and Description
public void
abortConnection()

Releases the connection without the option of keep-alive.

public void
releaseConnection()

Releases the connection with the option of keep-alive.

Method Detail

abortConnectionback to summary
public void abortConnection() throws IOException

Releases the connection without the option of keep-alive. This is a "hard" release that implies a shutdown of the connection. Use releaseConnection() for a graceful release.

Exceptions
IOException:
in case of an IO problem. The connection will be released anyway.
releaseConnectionback to summary
public void releaseConnection() throws IOException

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 abortConnection for a hard release. The connection may be reused as specified by the duration.

Exceptions
IOException:
in case of an IO problem. The connection will be released anyway.