@ThreadSafe class ConnectionHolder extends java.lang.Object implements ConnectionReleaseTrigger, Cancellable, java.io.Closeable
Constructor and Description |
---|
ConnectionHolder(Log log,
HttpClientConnectionManager manager,
HttpClientConnection managedConn) |
Modifier and Type | Method and Description |
---|---|
void |
abortConnection()
Releases the connection without the option of keep-alive.
|
boolean |
cancel() |
void |
close() |
boolean |
isReleased() |
boolean |
isReusable() |
void |
markNonReusable() |
void |
markReusable() |
void |
releaseConnection()
Releases the connection with the option of keep-alive.
|
void |
setState(java.lang.Object state) |
void |
setValidFor(long duration,
java.util.concurrent.TimeUnit tunit) |
public ConnectionHolder(Log log, HttpClientConnectionManager manager, HttpClientConnection managedConn)
public boolean isReusable()
public void markReusable()
public void markNonReusable()
public void setState(java.lang.Object state)
public void setValidFor(long duration, java.util.concurrent.TimeUnit tunit)
public void releaseConnection()
ConnectionReleaseTrigger
abortConnection
for a hard release. The
connection may be reused as specified by the duration.releaseConnection
in interface ConnectionReleaseTrigger
public void abortConnection()
ConnectionReleaseTrigger
ConnectionReleaseTrigger.releaseConnection()
for a graceful release.abortConnection
in interface ConnectionReleaseTrigger
public boolean cancel()
cancel
in interface Cancellable
public boolean isReleased()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException