Package com.crawljax.di
Class CrawlSessionProvider
- java.lang.Object
-
- com.crawljax.di.CrawlSessionProvider
-
- All Implemented Interfaces:
javax.inject.Provider<CrawlSession>
@Singleton public class CrawlSessionProvider extends Object implements javax.inject.Provider<CrawlSession>
Takes care of the lazy initialization of theCrawlSession.
-
-
Field Summary
Fields Modifier and Type Field Description private CrawljaxConfigurationconfigprivate AtomicBooleanisSetprivate static org.slf4j.LoggerLOGprivate com.codahale.metrics.MetricRegistryregistryprivate CrawlSessionsessionprivate InMemoryStateFlowGraphstateFlowGraph
-
Constructor Summary
Constructors Constructor Description CrawlSessionProvider(InMemoryStateFlowGraph stateFlowGraph, CrawljaxConfiguration config, com.codahale.metrics.MetricRegistry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CrawlSessionget()voidsetup(StateVertex indexState, CrawlerContext context)Alternate for consumervoidsetup(StateVertex indexState, CrawlTaskConsumer firstConsumer)
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
isSet
private final AtomicBoolean isSet
-
stateFlowGraph
private final InMemoryStateFlowGraph stateFlowGraph
-
config
private final CrawljaxConfiguration config
-
registry
private final com.codahale.metrics.MetricRegistry registry
-
session
private CrawlSession session
-
-
Constructor Detail
-
CrawlSessionProvider
@Inject public CrawlSessionProvider(InMemoryStateFlowGraph stateFlowGraph, CrawljaxConfiguration config, com.codahale.metrics.MetricRegistry registry)
-
-
Method Detail
-
setup
public void setup(StateVertex indexState, CrawlTaskConsumer firstConsumer)
- Parameters:
indexState- the root of the SFGfirstConsumer-- Throws:
IllegalStateException- when the method is invoked more than once.
-
setup
public void setup(StateVertex indexState, CrawlerContext context)
Alternate for consumer- Parameters:
indexState-context-
-
get
public CrawlSession get()
- Specified by:
getin interfacejavax.inject.Provider<CrawlSession>
-
-