Skip to content

Commit

Permalink
Remove classloadermanager dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-keller committed Mar 30, 2017
1 parent cf68f2d commit dae4aba
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/main/java/com/qwazr/crawler/web/WebCrawlerServer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2015-2016 Emmanuel Keller / QWAZR
* Copyright 2015-2017 Emmanuel Keller / QWAZR
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,6 @@
*/
package com.qwazr.crawler.web;

import com.qwazr.classloader.ClassLoaderManager;
import com.qwazr.cluster.ClusterManager;
import com.qwazr.library.LibraryManager;
import com.qwazr.scripts.ScriptManager;
Expand All @@ -36,21 +35,17 @@ public class WebCrawlerServer implements BaseServer {

private WebCrawlerServer(final ServerConfiguration configuration) throws IOException, URISyntaxException {
final ExecutorService executorService = Executors.newCachedThreadPool();
final ClassLoaderManager classLoaderManager =
new ClassLoaderManager(configuration.dataDirectory, Thread.currentThread());
final GenericServer.Builder builder =
GenericServer.of(configuration, executorService, classLoaderManager.getClassLoader())
.webService(WelcomeShutdownService.class);
classLoaderManager.registerContextAttribute(builder);
GenericServer.of(configuration, executorService).webService(WelcomeShutdownService.class);
final ClusterManager clusterManager =
new ClusterManager(executorService, configuration).registerHttpClientMonitoringThread(builder)
.registerProtocolListener(builder)
.registerWebService(builder);
final LibraryManager libraryManager = new LibraryManager(classLoaderManager, null, configuration.dataDirectory,
configuration.getEtcFiles()).registerWebService(builder);
final ScriptManager scriptManager =
new ScriptManager(executorService, classLoaderManager, clusterManager, libraryManager,
configuration.dataDirectory).registerWebService(builder);
final LibraryManager libraryManager =
new LibraryManager(null, configuration.dataDirectory, configuration.getEtcFiles()).registerWebService(
builder);
final ScriptManager scriptManager = new ScriptManager(executorService, clusterManager, libraryManager,
configuration.dataDirectory).registerWebService(builder);
final WebCrawlerManager webCrawlerManager =
new WebCrawlerManager(clusterManager, scriptManager, executorService).registerWebService(builder);
serviceBuilder = new WebCrawlerServiceBuilder(clusterManager, webCrawlerManager);
Expand Down

0 comments on commit dae4aba

Please sign in to comment.