Skip to content

Commit

Permalink
Update to server builder changes
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-keller committed Sep 12, 2017
1 parent 2e17c6e commit 22d7503
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/qwazr/crawler/CrawlerServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.qwazr.server.ApplicationBuilder;
import com.qwazr.server.BaseServer;
import com.qwazr.server.GenericServer;
import com.qwazr.server.GenericServerBuilder;
import com.qwazr.server.RestApplication;
import com.qwazr.server.WelcomeShutdownService;
import com.qwazr.server.configuration.ServerConfiguration;
Expand All @@ -48,7 +49,7 @@ public class CrawlerServer implements BaseServer {

private CrawlerServer(final ServerConfiguration configuration) throws IOException, URISyntaxException {
final ExecutorService executorService = Executors.newCachedThreadPool();
final GenericServer.Builder builder = GenericServer.of(configuration, executorService);
final GenericServerBuilder builder = GenericServer.of(configuration, executorService);

final Set<String> services = new HashSet<>();
services.add(ClusterServiceInterface.SERVICE_NAME);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/qwazr/crawler/file/FileCrawlerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.qwazr.crawler.common.CrawlSessionImpl;
import com.qwazr.scripts.ScriptManager;
import com.qwazr.server.ApplicationBuilder;
import com.qwazr.server.GenericServer;
import com.qwazr.server.GenericServerBuilder;
import com.qwazr.utils.LoggerUtils;
import com.qwazr.utils.TimeTracker;

Expand Down Expand Up @@ -50,7 +50,7 @@ public FileCrawlerServiceInterface getService() {
return service;
}

public FileCrawlerManager registerContextAttribute(final GenericServer.Builder builder) {
public FileCrawlerManager registerContextAttribute(final GenericServerBuilder builder) {
builder.contextAttribute(this);
return this;
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/qwazr/crawler/web/WebCrawlerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.qwazr.crawler.common.CrawlSessionImpl;
import com.qwazr.scripts.ScriptManager;
import com.qwazr.server.ApplicationBuilder;
import com.qwazr.server.GenericServer;
import com.qwazr.server.GenericServerBuilder;
import com.qwazr.utils.LoggerUtils;
import com.qwazr.utils.TimeTracker;
import com.qwazr.utils.http.HttpClients;
Expand All @@ -45,7 +45,7 @@ public WebCrawlerManager(ClusterManager clusterManager, ScriptManager scriptMana
this(clusterManager.getService().getStatus().me, scriptManager, executorService);
}

public WebCrawlerManager registerHttpClientMonitoringThread(final GenericServer.Builder builder) {
public WebCrawlerManager registerHttpClientMonitoringThread(final GenericServerBuilder builder) {
final HttpClients.IdleConnectionMonitorThread monitorThread =
HttpClients.getNewMonitorThread(30 * 1000, 60 * 60 * 1000);
builder.shutdownListener(server -> monitorThread.shutdown());
Expand All @@ -57,7 +57,7 @@ public WebCrawlerServiceInterface getService() {
return service;
}

public WebCrawlerManager registerContextAttribute(final GenericServer.Builder builder) {
public WebCrawlerManager registerContextAttribute(final GenericServerBuilder builder) {
builder.contextAttribute(this);
return this;
}
Expand Down

0 comments on commit 22d7503

Please sign in to comment.