in src/main/java/org/apache/nutch/webui/service/impl/CrawlServiceImpl.java [59:81]
public void startCrawl(Long crawlId, NutchInstance instance) {
Crawl crawl = null;
try {
crawl = crawlDao.queryForId(crawlId);
if(crawl.getCrawlId()==null) {
crawl.setCrawlId("crawl-" + crawlId.toString());
}
NutchClient client = nutchClientFactory.getClient(instance);
String seedDirectory = client.createSeed(crawl.getSeedList());
crawl.setSeedDirectory(seedDirectory);
List<RemoteCommand> commands = commandFactory.createCommands(crawl);
RemoteCommandExecutor executor = new RemoteCommandExecutor(client);
CrawlingCycle cycle = new CrawlingCycle(this, executor, crawl, commands);
cycle.executeCrawlCycle();
} catch (Exception e) {
crawl.setStatus(CrawlStatus.ERROR);
saveCrawl(crawl);
LOG.error("exception occured", e);
}
}