Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.http
Interface HttpConnection  view HttpConnection download HttpConnection.java

All Known Subinterfaces:
HttpClientConnection, HttpProxyConnection, HttpServerConnection

public interface HttpConnection

A generic HTTP connection, useful on client and server side.

Since:
4.0
Version:
$Revision: 391135 $

Method Summary
 void close()
          This method will gracefully close the connection.
 boolean isOpen()
          Checks if this connection is open.
 boolean isStale()
          Network connections may get closed during some time of inactivity for several reasons.
 void shutdown()
          This method will force close the connection.
 

Method Detail

close

public void close()
           throws java.io.IOException
This method will gracefully close the connection. It will attempt to flush the transmitter's internal buffer prior to closing the underlying socket. This method MAY NOT be called from a different thread to force shutdown the connection. Use #shutdown() instead.


isOpen

public boolean isOpen()
Checks if this connection is open.


isStale

public boolean isStale()
Network connections may get closed during some time of inactivity for several reasons. The next time a read is attempted on such a connection it will throw an IOException. This method tries to alleviate this inconvenience by trying to find out if a connection is still usable. Implementations may do that by attempting a read with a very small timeout. Thus this method may block for a small indefinite time before returning a result.


shutdown

public void shutdown()
              throws java.io.IOException
This method will force close the connection. This is the only method, which may be called from a different thread to terminate the connection. This method will not attempt to flush the transmitter's internal buffer prior to closing the underlying socket.