-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
@Component() public final class LoadComponent implements AutoCloseable
Created by vincent on 17-7-15. Copyright @ 2013-2017 Platon AI. All rights reserved
Load pages from storage or fetch from the Internet if it's not fetched or expired
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLoadComponent.Companion
-
Field Summary
Fields Modifier and Type Field Description private final GlobalCacheglobalCacheprivate final ConcurrentExpiringLRUCache<String, WebPage>pageCacheprivate final ConcurrentExpiringLRUCache<String, FeaturedDocument>documentCacheprivate final WebDbwebDbprivate final GlobalCacheFactoryglobalCacheFactoryprivate final BatchFetchComponentfetchComponentprivate final ParseComponentparseComponentprivate final UpdateComponentupdateComponentprivate final ImmutableConfigimmutableConfigprivate final AppStatusTrackerstatusTracker
-
Constructor Summary
Constructors Constructor Description LoadComponent(WebDb webDb, GlobalCacheFactory globalCacheFactory, BatchFetchComponent fetchComponent, ParseComponent parseComponent, UpdateComponent updateComponent, ImmutableConfig immutableConfig, AppStatusTracker statusTracker)
-
Method Summary
Modifier and Type Method Description final GlobalCachegetGlobalCache()final ConcurrentExpiringLRUCache<String, WebPage>getPageCache()final ConcurrentExpiringLRUCache<String, FeaturedDocument>getDocumentCache()final WebDbgetWebDb()final GlobalCacheFactorygetGlobalCacheFactory()final BatchFetchComponentgetFetchComponent()final ParseComponentgetParseComponent()final UpdateComponentgetUpdateComponent()final ImmutableConfiggetImmutableConfig()final AppStatusTrackergetStatusTracker()final CheckStatefetchState(WebPage page, LoadOptions options)final WebPageload(URL url, LoadOptions options)final WebPageload(NormUrl normUrl)final WebPageloadDeferred(NormUrl normUrl)final WebPageloadWithRetry(NormUrl normUrl)final WebPageloadWithRetryDeferred(NormUrl normUrl)final CompletableFuture<WebPage>loadAsync(NormUrl normUrl)Load a page specified by normUrl, wait until all pages are loaded or timeout final List<WebPage>loadAll(Iterable<NormUrl> normUrls)Load all pages specified by normUrls, wait until all pages are loaded or timeout final List<CompletableFuture<WebPage>>loadAllAsync(Iterable<NormUrl> normUrls)Load all pages specified by normUrls, wait until all pages are loaded or timeout final Unitflush()Unitclose()-
-
Constructor Detail
-
LoadComponent
LoadComponent(WebDb webDb, GlobalCacheFactory globalCacheFactory, BatchFetchComponent fetchComponent, ParseComponent parseComponent, UpdateComponent updateComponent, ImmutableConfig immutableConfig, AppStatusTracker statusTracker)
-
-
Method Detail
-
getGlobalCache
final GlobalCache getGlobalCache()
-
getPageCache
final ConcurrentExpiringLRUCache<String, WebPage> getPageCache()
-
getDocumentCache
final ConcurrentExpiringLRUCache<String, FeaturedDocument> getDocumentCache()
-
getWebDb
final WebDb getWebDb()
-
getGlobalCacheFactory
final GlobalCacheFactory getGlobalCacheFactory()
-
getFetchComponent
final BatchFetchComponent getFetchComponent()
-
getParseComponent
final ParseComponent getParseComponent()
-
getUpdateComponent
final UpdateComponent getUpdateComponent()
-
getImmutableConfig
final ImmutableConfig getImmutableConfig()
-
getStatusTracker
final AppStatusTracker getStatusTracker()
-
fetchState
final CheckState fetchState(WebPage page, LoadOptions options)
-
load
final WebPage load(URL url, LoadOptions options)
-
loadDeferred
final WebPage loadDeferred(NormUrl normUrl)
-
loadWithRetry
final WebPage loadWithRetry(NormUrl normUrl)
-
loadWithRetryDeferred
final WebPage loadWithRetryDeferred(NormUrl normUrl)
-
loadAsync
final CompletableFuture<WebPage> loadAsync(NormUrl normUrl)
Load a page specified by normUrl, wait until all pages are loaded or timeout
-
loadAll
final List<WebPage> loadAll(Iterable<NormUrl> normUrls)
Load all pages specified by normUrls, wait until all pages are loaded or timeout
-
loadAllAsync
final List<CompletableFuture<WebPage>> loadAllAsync(Iterable<NormUrl> normUrls)
Load all pages specified by normUrls, wait until all pages are loaded or timeout
-
-
-
-