-
public final class ConcurrentStatefulDriverPoolPoolA concurrent pool of loading driver pools whose states are tracked.
-
-
Field Summary
Fields Modifier and Type Field Description private final Map<BrowserId, LoadingWebDriverPool>workingDriverPoolsprivate final Map<BrowserId, LoadingWebDriverPool>retiredDriverPoolsprivate final Set<BrowserId>closedDriverPools
-
Constructor Summary
Constructors Constructor Description ConcurrentStatefulDriverPoolPool()
-
Method Summary
Modifier and Type Method Description final Map<BrowserId, LoadingWebDriverPool>getWorkingDriverPools()final Map<BrowserId, LoadingWebDriverPool>getRetiredDriverPools()final Set<BrowserId>getClosedDriverPools()final IntegerpromisedDriverCount(BrowserId browserId, Integer capacity)Return the number of new drivers can offer by the pool at the calling time point. final BooleanisFullCapacity(BrowserId browserId)Check if a webdriver pool is full capacity, so it can not provide a webdriver for new tasks. final BooleanisRetiredPool(BrowserId browserId)final WebDriversubscribeDriver(BrowserId browserId)final WebDriversubscribeDriver()final LoadingWebDriverPoolcomputeIfAbsent(BrowserId browserId, Function1<BrowserId, LoadingWebDriverPool> mappingFunction)final Unitretire(LoadingWebDriverPool driverPool)final LoadingWebDriverPoolretire(BrowserId browserId)final Unitclose(LoadingWebDriverPool driverPool)final Unitclose()-
-
Method Detail
-
getWorkingDriverPools
final Map<BrowserId, LoadingWebDriverPool> getWorkingDriverPools()
-
getRetiredDriverPools
final Map<BrowserId, LoadingWebDriverPool> getRetiredDriverPools()
-
getClosedDriverPools
final Set<BrowserId> getClosedDriverPools()
-
promisedDriverCount
@Synchronized() final Integer promisedDriverCount(BrowserId browserId, Integer capacity)
Return the number of new drivers can offer by the pool at the calling time point.
If the driver pool is retired or closed, no new driver can offer. If the driver pool is not created yet, it can offer capacity drivers at top.
- Parameters:
browserId- The id of the webdriver pool.capacity- The capacity of a driver pool.
-
isFullCapacity
@Synchronized() final Boolean isFullCapacity(BrowserId browserId)
Check if a webdriver pool is full capacity, so it can not provide a webdriver for new tasks. Note that if a driver pool is retired or closed, it's not full capacity.
- Parameters:
browserId- The id of the webdriver pool.
-
isRetiredPool
@Synchronized() final Boolean isRetiredPool(BrowserId browserId)
-
subscribeDriver
@Beta()@Synchronized() final WebDriver subscribeDriver(BrowserId browserId)
-
subscribeDriver
@Beta()@Synchronized() final WebDriver subscribeDriver()
-
computeIfAbsent
@Synchronized() final LoadingWebDriverPool computeIfAbsent(BrowserId browserId, Function1<BrowserId, LoadingWebDriverPool> mappingFunction)
-
retire
@Synchronized() final Unit retire(LoadingWebDriverPool driverPool)
-
retire
@Synchronized() final LoadingWebDriverPool retire(BrowserId browserId)
-
close
@Synchronized() final Unit close(LoadingWebDriverPool driverPool)
-
close
@Synchronized() final Unit close()
-
-
-
-