public final class Crawler extends Object implements Interruptible
Modifier and Type | Class and Description |
---|---|
static class |
Crawler.AsyncCrawlerCallbackProcessor
This class methods is executed upon the completion of fetcher.
|
static class |
Crawler.Builder
A builder for crawler class.
|
Modifier and Type | Method and Description |
---|---|
static Crawler |
buildDefault()
Builds a new default instance of Crawler.
|
static Crawler.Builder |
builder()
Creates a new instance of Builder.
|
void |
close() |
Scheduler |
getScheduler()
Get the instance of scheduler used.
|
void |
interruptAndClose()
Interrupt a thread and then close it.
|
Crawler |
start()
Starts the crawler by starting a new thread to poll for jobs.
|
Crawler |
startAndClose()
Starts the crawler by starting a new thread to poll for jobs and close it
after the queue has reached 0.
|
public static Crawler.Builder builder()
public static Crawler buildDefault()
public Scheduler getScheduler()
public Crawler start()
public Crawler startAndClose() throws Exception
Exception
- if this resource cannot be closed.public void interruptAndClose() throws Exception
Interruptible
interruptAndClose
in interface Interruptible
Exception
- Exception.public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2019. All rights reserved.