public void setFormat(OMOutputFormat format) {
this.format = format;
}
protected HttpClient getHttpClient(MessageContext msgContext) {
HttpClient httpClient;
final ConfigurationContext configContext = msgContext.getConfigurationContext();
synchronized (lock) {
httpClient = (HttpClient) configContext.getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
if (httpClient == null) {
log.trace("Making new ConnectionManager");
HttpConnectionManager connManager = new MultiThreadedHttpConnectionManager();
// In case we need to set any params, do it here, but for now use defaults.
// HttpConnectionManagerParams params = new HttpConnectionManagerParams();
// params.setMaxConnectionsPerHost(HostConfiguration.ANY_HOST_CONFIGURATION, 200);
// etc...
// connManager.setParams(params);
httpClient = new HttpClient(connManager);
HttpClientParams clientParams = new HttpClientParams();
// Set the default timeout in case we have a connection pool starvation to 30sec
clientParams.setConnectionManagerTimeout(30000);
httpClient.setParams(clientParams);
configContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
}
// Get the timeout values set in the runtime
initializeTimeouts(msgContext, httpClient);