Configuration routesConf = configuration.subset("proxy.http.route");
if (!connManagerParamsConf.isEmpty() || !routesConf.isEmpty())
{
HttpParams connManagerParams = new BasicHttpParams();
ConnManagerParamBean connManagerParamBean = new ConnManagerParamBean(connManagerParams);
setBeanPropertiesByConfiguration(connManagerParamBean, connManagerParamsConf);
Map<HttpHost, HttpRoute> proxyRouteMap = new HashMap<HttpHost, HttpRoute>();
if (!routesConf.isEmpty())
{
ConnPerRouteBean connPerRouteBean = new ConnPerRouteBean();
setBeanPropertiesByConfiguration(connPerRouteBean, routesConf.subset("param"));
Map<HttpRoute, Integer> maxForRoutes = new HashMap<HttpRoute, Integer>();
String [] routeNames = routesConf.getStringArray("");
for (String routeName : routeNames)
{
Configuration routeConf = routesConf.subset(routeName);
try
{
HttpRoute httpRoute = buildHttpRoute(routeConf);
int maxConnections = routeConf.getInt("maxConnections", -1);
if (maxConnections >= 0)
{
maxForRoutes.put(httpRoute, maxConnections);
}
if (httpRoute.getProxyHost() != null)
{
proxyRouteMap.put(httpRoute.getTargetHost(), httpRoute);
}
}
catch (Exception e)
{
throw new ServletException(e);
}
}
connPerRouteBean.setMaxForRoutes(maxForRoutes);
connManagerParamBean.setConnectionsPerRoute(connPerRouteBean);
}
tempProxyService.setConnectionManagerParams(connManagerParams);
if (!proxyRouteMap.isEmpty())