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

This commit is contained in:
Greg Wilkins 2012-05-22 08:14:07 -04:00 committed by Gerrit Code Review @ Eclipse.org
commit 4ed88e71e0

View File

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