}
}, httpService);
}
private void migrateRequestProcessing(NetworkConfig config, HttpService httpService) throws TransactionFailure {
final RequestProcessing request = httpService.getRequestProcessing();
if (request == null) {
return;
}
ConfigSupport.apply(new SingleConfigCode<ThreadPool>() {
@Override
public Object run(ThreadPool pool) throws PropertyVetoException {
pool.setMaxThreadPoolSize(request.getThreadCount());
pool.setMinThreadPoolSize(request.getInitialThreadCount());
if (pool.getMinThreadPoolSize() == null || Integer.parseInt(pool.getMinThreadPoolSize()) < 2) {
pool.setMinThreadPoolSize("2");
}
return null;
}
}, habitat.getComponent(ThreadPool.class, HTTP_THREAD_POOL));
for (NetworkListener listener : config.getNetworkListeners().getNetworkListener()) {
ConfigSupport.apply(new SingleConfigCode<NetworkListener>() {
@Override
public Object run(NetworkListener param) {
param.setThreadPool(HTTP_THREAD_POOL);
return null;
}
}, listener);
}
for (Protocol protocol : config.getProtocols().getProtocol()) {
final Http http = protocol.getHttp();
if(http != null) {
ConfigSupport.apply(new SingleConfigCode<Http>() {
@Override
public Object run(Http param) {
param.setHeaderBufferLengthBytes(request.getHeaderBufferLengthInBytes());
return null;
}
}, http);
}
}