class HttpServerFactory implements ServerFactory {

    @Override
    public HttpServer createServer(SecurityComponentsProvider securityProvider, String protocol, String host, int port,
            String serverKey, Toolbox toolbox)
    {
        Supplier<? extends Component> parentComponent = toolbox.getUIRegistry().getMainFrameProvider();
        SecurityManager securityManager = toolbox.getSecurityManager();
        PreferencesRegistry prefsRegistry = toolbox.getPreferencesRegistry();
        NetworkConfigurationManager networkConfigurationManager = toolbox.getSystemToolbox().getNetworkConfigurationManager();
        ServerToolbox serverTools = ServerToolboxUtils.getServerToolbox(toolbox);

        HttpClient httpClient = new DefaultHttpClient();

        ConfigurerParameters parameters = new ConfigurerParameters();
        parameters.setClient(httpClient);
        parameters.setHost(host);
        parameters.setParentComponent(parentComponent);
        parameters.setPort(port);
        parameters.setPrefsRegistry(prefsRegistry);
        parameters.setProvider(securityProvider);
        parameters.setSecurityManager(securityManager);
        parameters.setServerKey(serverKey);
        parameters.setNetworkConfigurationManager(networkConfigurationManager);

        new ProxyConfigurer().configure(parameters);
        new BasicAuthConfigurer().configure(parameters);
        new CertificateConfigurer().configure(parameters);
        new TimeoutsConfigurer().configure(parameters, prefsRegistry, serverTools);
        new ConnectionPoolConfigurer().configure(httpClient);

        RequestorProviderImpl provider = new RequestorProviderImpl(httpClient,
                new HeaderValuesImpl(toolbox.getGeometryRegistry().getRenderingCapabilities().getRendererIdentifier()),
                toolbox.getEventManager(), toolbox.getSystemToolbox().getNetworkConfigurationManager());
        HttpServerImpl server = new HttpServerImpl(host, protocol, provider);

        return server;
    }

}