@Test public void willTakeConfigIntoAccountWhenCreatingManager() { Config config = new Config().concurrency(88, 42); SecurityConfig sec = new SecurityConfig(config); PoolingHttpClientConnectionManager manager = sec.createManager(); assertEquals(88, manager.getMaxTotal()); assertEquals(42, manager.getDefaultMaxPerRoute()); }
public PoolingHttpClientConnectionManager createManager() { PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(buildSocketFactory(), null, null, null, config.getTTL(), TimeUnit.MILLISECONDS); manager.setMaxTotal(config.getMaxConnections()); manager.setDefaultMaxPerRoute(config.getMaxPerRoutes()); return manager; }
SecurityConfig { public PoolingHttpClientConnectionManager createManager() { PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(buildSocketFactory(), null, null, null, config.getTTL(), TimeUnit.MILLISECONDS); manager.setMaxTotal(config.getMaxConnections()); manager.setDefaultMaxPerRoute(config.getMaxPerRoutes()); return manager; } }
SecurityConfig { public PoolingHttpClientConnectionManager createManager() { PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(buildSocketFactory(), null, null, null, config.getTTL(), TimeUnit.MILLISECONDS); manager.setMaxTotal(config.getMaxConnections()); manager.setDefaultMaxPerRoute(config.getMaxPerRoutes()); return manager; } SecurityConfig(Config config); }
SecurityConfig { public PoolingHttpClientConnectionManager createManager() { PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(buildSocketFactory(), null, null, null, config.getTTL(), TimeUnit.MILLISECONDS); manager.setMaxTotal(config.getMaxConnections()); manager.setDefaultMaxPerRoute(config.getMaxPerRoutes()); return manager; } SecurityConfig(Config config); PoolingHttpClientConnectionManager createManager(); void configureSecurity(HttpClientBuilder cb); }
SecurityConfig { public PoolingHttpClientConnectionManager createManager() { PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(buildSocketFactory(), null, null, null, config.getTTL(), TimeUnit.MILLISECONDS); manager.setMaxTotal(config.getMaxConnections()); manager.setDefaultMaxPerRoute(config.getMaxPerRoutes()); return manager; } SecurityConfig(Config config); PoolingHttpClientConnectionManager createManager(); void configureSecurity(HttpClientBuilder cb);  }