View Javadoc

1   package com.eviware.soapui.impl.wsdl.support;
2   
3   import org.apache.commons.httpclient.HttpClient;
4   import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
5   
6   /***
7    * HttpClient related tools
8    * 
9    * @author Ole.Matzura
10   */
11  
12  public class HttpClientSupport {
13  
14  	private static final Integer lock = new Integer( 9 );
15  	private static HttpClient instance;
16  	
17  	public static HttpClient getHttpClient()
18  	{
19  		if( instance == null )
20  		{
21  			synchronized( lock )
22  			{
23  				if( instance == null )
24  				{
25  					MultiThreadedHttpConnectionManager connectionManager = 
26  		      		new MultiThreadedHttpConnectionManager();
27  		      	instance = new HttpClient(connectionManager);
28  				}
29  			}			
30  		}
31  		
32  		return instance;
33  	}
34  	
35  }