org.alfresco.bm.http
Class SharedHttpClientProvider

java.lang.Object
  extended by org.alfresco.bm.http.SharedHttpClientProvider
All Implemented Interfaces:
HttpClientProvider

public final class SharedHttpClientProvider
extends Object
implements HttpClientProvider

A class responsible for managing one shared HttpClient instance. This uses a thread-safe connection-manager instead of creating a new istance on every call. This is done for the folowing reasons:

Author:
Frederik Heremans

Constructor Summary
SharedHttpClientProvider(String alfrescoUrl, int maxNumberOfConnections)
           
 
Method Summary
 String getFullAlfrescoUrlForPath(String path)
           
 org.apache.commons.httpclient.HttpClient getHttpClient()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedHttpClientProvider

public SharedHttpClientProvider(String alfrescoUrl,
                                int maxNumberOfConnections)
Method Detail

getFullAlfrescoUrlForPath

public String getFullAlfrescoUrlForPath(String path)
Specified by:
getFullAlfrescoUrlForPath in interface HttpClientProvider
Parameters:
path - relative path of the URL from alfresco host.
Returns:
full URL including hostname and port for the given path.

getHttpClient

public org.apache.commons.httpclient.HttpClient getHttpClient()
Specified by:
getHttpClient in interface HttpClientProvider
Returns:
the HttpClient instance to use for the next HTTP-call.


Copyright © 2012. All Rights Reserved.