Hi Steve..

I have the following helper class using an internal static helper to avoid synchronization requirements..

public class HttpClientSupport
{
   private final static Helper helper = new Helper();
private static class Helper
   {
       private HttpClient httpClient;
public Helper()
       {
           MultiThreadedHttpConnectionManager connectionManager =
             new MultiThreadedHttpConnectionManager();
connectionManager.getParams().setDefaultMaxConnectionsPerHost( 500 );
           connectionManager.getParams().setMaxTotalConnections( 2000 );
         httpClient = new HttpClient(connectionManager);
         System.out.println( "Created http client" );
       }
public HttpClient getHttpClient()
       {
           return httpClient;
       }
   }

   public static HttpClient getHttpClient()
   {
       return helper.getHttpClient();
   }
}

I then get hold of the HttpClient in my request threads with

HttpClientSupport.getHttpClient()

anyway, the "Created http client" only shows up once in my console.:

maybe something is wrong in the above code?

regards!

/Ole


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to