Package com.crawljax.core
Class ExitNotifier
- java.lang.Object
-
- com.crawljax.core.ExitNotifier
-
@Singleton @ThreadSafe public class ExitNotifier extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExitNotifier.ExitStatusRepresents the reason Crawljax stopped.
-
Field Summary
Fields Modifier and Type Field Description private CountDownLatchlatchprivate intmaxStatesprivate ExitNotifier.ExitStatusreasonprivate AtomicIntegerstates
-
Constructor Summary
Constructors Constructor Description ExitNotifier(int maxStates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExitNotifier.ExitStatusawaitTermination()Waits until the crawl has to stop.intincrementNumberOfStates()(package private) booleanisExitCalled()voidsignalCrawlExhausted()Signal that allCrawlTaskConsumers are done.voidsignalTimeIsUp()voidstop()Manually stop the crawl.
-
-
-
Field Detail
-
latch
private final CountDownLatch latch
-
states
private final AtomicInteger states
-
maxStates
private final int maxStates
-
reason
private ExitNotifier.ExitStatus reason
-
-
Method Detail
-
awaitTermination
public ExitNotifier.ExitStatus awaitTermination() throws InterruptedException
Waits until the crawl has to stop.- Returns:
- the termination condition
- Throws:
InterruptedException- When the wait is interrupted.
-
incrementNumberOfStates
public int incrementNumberOfStates()
- Returns:
- The new number of states.
-
signalTimeIsUp
public void signalTimeIsUp()
-
signalCrawlExhausted
public void signalCrawlExhausted()
Signal that allCrawlTaskConsumers are done.
-
stop
public void stop()
Manually stop the crawl.
-
isExitCalled
boolean isExitCalled()
-
-