Package org.apache.http.conn
Interface ConnectionReleaseTrigger
-
- All Known Subinterfaces:
ManagedClientConnection
- All Known Implementing Classes:
AbstractClientConnAdapter
,AbstractPooledConnAdapter
,BasicManagedEntity
,BasicPooledConnAdapter
,EofSensorInputStream
public interface ConnectionReleaseTrigger
Interface for releasing a connection. This can be implemented by various "trigger" objects which are associated with a connection, for example aEofSensorInputStream
or theManagedHttpClientConnection
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abortConnection()
Releases the connection without the option of keep-alive.void
releaseConnection()
Releases the connection with the option of keep-alive.
-
-
-
Method Detail
-
releaseConnection
void releaseConnection() throws java.io.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. UseabortConnection
for a hard release. The connection may be reused as specified by the duration.- Throws:
java.io.IOException
- in case of an IO problem. The connection will be released anyway.
-
abortConnection
void abortConnection() throws java.io.IOException
Releases the connection without the option of keep-alive. This is a "hard" release that implies a shutdown of the connection. UsereleaseConnection()
for a graceful release.- Throws:
java.io.IOException
- in case of an IO problem. The connection will be released anyway.
-
-