private PoolingOptions getPoolingOptions(Properties connectionProperties)
{
// minSimultaneousRequests, maxSimultaneousRequests, coreConnections,
// maxConnections
PoolingOptions options = new PoolingOptions();
String hostDistance = connectionProperties.getProperty("hostDistance");
String minSimultaneousRequests = connectionProperties.getProperty("minSimultaneousRequests");
String maxSimultaneousRequests = connectionProperties.getProperty("maxSimultaneousRequests");
String coreConnections = connectionProperties.getProperty("coreConnections");
String maxConnections = connectionProperties.getProperty("maxConnections");
if (!StringUtils.isBlank(hostDistance))
{
HostDistance hostDist = HostDistance.valueOf(hostDistance.toUpperCase());
if (!StringUtils.isBlank(coreConnections))
{
options.setCoreConnectionsPerHost(HostDistance.LOCAL, new Integer(coreConnections));
}
if (!StringUtils.isBlank(maxConnections))
{
options.setMaxConnectionsPerHost(hostDist, new Integer(maxConnections));
}
if (!StringUtils.isBlank(minSimultaneousRequests))
{
options.setMinSimultaneousRequestsPerConnectionThreshold(hostDist, new Integer(minSimultaneousRequests));
}
if (!StringUtils.isBlank(maxSimultaneousRequests))
{
options.setMaxSimultaneousRequestsPerConnectionThreshold(hostDist, new Integer(maxSimultaneousRequests));
}
}
return options;
}