Class BrowserManager
-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public class BrowserManager implements AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description private final Map<BrowserId, Browser>browsersprivate final BrowserFactorybrowserFactoryprivate final ImmutableConfigconf
-
Constructor Summary
Constructors Constructor Description BrowserManager(BrowserFactory browserFactory, ImmutableConfig conf)
-
Method Summary
Modifier and Type Method Description final Map<BrowserId, Browser>getBrowsers()The active browsers final BrowserFactorygetBrowserFactory()final ImmutableConfiggetConf()final BrowserfindBrowserOrNull(BrowserId browserId)Find an existing browser by id. final BooleanisActive(BrowserId browserId)Check if the browser is active. final UnitcloseBrowser(BrowserId browserId)Close a browser. final UnitcloseBrowser(Browser browser)final UnitdestroyBrowserForcibly(BrowserId browserId)final UnitcloseDriver(WebDriver driver)final WebDriverfindLeastValuableDriver()final UnitcloseLeastValuableDriver()final UnitdestroyZombieBrowsersForcibly()Destroy the zombie browsers forcibly, kill the associated browser processes, release all allocated resources, regardless of whether the browser is closed or not. final Unitmaintain()Unitclose()-
-
Method Detail
-
getBrowsers
final Map<BrowserId, Browser> getBrowsers()
The active browsers
-
getBrowserFactory
final BrowserFactory getBrowserFactory()
-
getConf
final ImmutableConfig getConf()
-
findBrowserOrNull
@Synchronized() final Browser findBrowserOrNull(BrowserId browserId)
Find an existing browser by id. If the browser is not found, return null.
- Parameters:
browserId- The browser id- Returns:
The browser or null if not found
-
closeBrowser
@Synchronized() final Unit closeBrowser(BrowserId browserId)
Close a browser.
-
closeBrowser
@Synchronized() final Unit closeBrowser(Browser browser)
-
destroyBrowserForcibly
@Synchronized() final Unit destroyBrowserForcibly(BrowserId browserId)
-
closeDriver
@Synchronized() final Unit closeDriver(WebDriver driver)
-
findLeastValuableDriver
@Synchronized() final WebDriver findLeastValuableDriver()
-
closeLeastValuableDriver
@Synchronized() final Unit closeLeastValuableDriver()
-
destroyZombieBrowsersForcibly
@Synchronized() final Unit destroyZombieBrowsersForcibly()
Destroy the zombie browsers forcibly, kill the associated browser processes, release all allocated resources, regardless of whether the browser is closed or not.
-
close
@Synchronized() Unit close()
-
-
-
-