public void configure(WebSearchEngine engine, EngineConfiguration engineConfiguration)
            throws ConfigurationException {
        acceptor.getSources().clear();
        acceptor.getWebClients().clear();
        Boolean shareBrowser = engineConfiguration.getShareBrowser();
        BrowserVersion browserVersion = engineConfiguration.getBrowserVersion();
        Boolean javaScriptEnabled = engineConfiguration.getJavaScriptEnabled();
        WebClient webClient = null;
        if (shareBrowser) {
            webClient = initWebClient(browserVersion, javaScriptEnabled);
        } else {
            if (browserVersion != null) {
                throw new RuntimeException(
                        "Browser version should not be specified when browser is not shared.");
            }
            if (javaScriptEnabled != null) {
                throw new RuntimeException(
                        "Enable JavaScript option should not be specified when browser is not shared.");
            }
        }
        if (engineConfiguration.getSources() == null
                || engineConfiguration.getSources().size() == 0) {
            throw new RuntimeException("At least one source configuration is required.");
        }
        for (SourceConfiguration sourceConfiguration : engineConfiguration.getSources()) {
            webClient = handleSourceConfiguration(shareBrowser, webClient, sourceConfiguration);
        }
    }