379194 - ProxyServlet enhancement to enable easy creation of alternative HttpClient implementations

Change-Id: I8246947afa7f3921150efef2040006e346cd0ca5
This commit is contained in:
pgdad 2012-05-10 21:58:33 -04:00
parent 5687aa8beb
commit af0a8e4aeb

View File

@ -173,6 +173,16 @@ public class ProxyServlet implements Servlet
return Log.getLogger("org.eclipse.jetty.servlets." + config.getServletName());
}
/**
* Create and return an HttpClientInstance
*
* @return HttpClient
*/
protected HttpClient createHttpClientInstance()
{
return new HttpClient();
}
/**
* Create and return an HttpClient based on ServletConfig
*
@ -185,7 +195,7 @@ public class ProxyServlet implements Servlet
*/
protected HttpClient createHttpClient(ServletConfig config) throws Exception
{
HttpClient client = new HttpClient();
HttpClient client = createHttpClientInstance();
client.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
String t = config.getInitParameter("maxThreads");