xsul.http_client
Class HttpClientReuseLastConnectionManager

java.lang.Object
  extended byxsul.http_client.HttpClientConnectionManager
      extended byxsul.http_client.HttpClientReuseLastConnectionManager

public class HttpClientReuseLastConnectionManager
extends HttpClientConnectionManager

Manages connection.
NOTE: this class is multi-thread safe however for good performance is shoul d used from only one thread that needs to conenct multiple time to the smae host:port as this manager will reuse such connection.

Version:
$Revision: 1.9 $
Author:
Aleksander Slominski

Method Summary
 HttpClientRequest connect(java.lang.String host, int port, int timeout)
          As defiend in Socket a timeout of zero is interpreted as an infinite timeout
static HttpClientConnectionManager newInstance()
           
static HttpClientConnectionManager newInstance(ClientSocketFactory socketFactory)
           
 void notifyConnectionForReuse(ClientSocketConnection conn)
          This method is called by HttpClientRequest/Response when HTTP request/response is finished and it is safe to assume that thsi particular conenctions is finished
 void shutdownAndReclaimResources()
          This method should be overriden by subclasses to free any resources that were not released.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static HttpClientConnectionManager newInstance()

newInstance

public static HttpClientConnectionManager newInstance(ClientSocketFactory socketFactory)

connect

public HttpClientRequest connect(java.lang.String host,
                                 int port,
                                 int timeout)
                          throws HttpClientException
As defiend in Socket a timeout of zero is interpreted as an infinite timeout

Overrides:
connect in class HttpClientConnectionManager
Throws:
HttpClientException

notifyConnectionForReuse

public void notifyConnectionForReuse(ClientSocketConnection conn)
                              throws HttpClientException
Description copied from class: HttpClientConnectionManager
This method is called by HttpClientRequest/Response when HTTP request/response is finished and it is safe to assume that thsi particular conenctions is finished

Overrides:
notifyConnectionForReuse in class HttpClientConnectionManager
Throws:
HttpClientException

shutdownAndReclaimResources

public void shutdownAndReclaimResources()
                                 throws HttpClientException
Description copied from class: HttpClientConnectionManager
This method should be overriden by subclasses to free any resources that were not released. This simple class has no resources to reclaim - this manager (factory) is stateless.

Overrides:
shutdownAndReclaimResources in class HttpClientConnectionManager
Throws:
HttpClientException


IU Extreme! Lab (http://www.extreme.indiana.edu)