Class DevicePool<Driver extends org.openqa.selenium.WebDriver>

java.lang.Object
io.webdevice.device.DevicePool<Driver>
All Implemented Interfaces:
DeviceProvider<Driver>, java.util.function.Consumer<Device<Driver>>, java.util.function.Supplier<Device<Driver>>

public class DevicePool<Driver extends org.openqa.selenium.WebDriver>
extends java.lang.Object
implements DeviceProvider<Driver>
A naive and unoptimized Device pool
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
      DevicePool​(java.lang.String name, DeviceProvider<Driver> provider, java.util.function.Function<Device<Driver>,​java.lang.Boolean> test)  
    protected DevicePool​(java.lang.String name, DeviceProvider<Driver> provider, java.util.function.Function<Device<Driver>,​java.lang.Boolean> test, java.util.concurrent.BlockingDeque<Device<Driver>> free, java.util.concurrent.BlockingDeque<Device<Driver>> used)  
  • Method Summary

    Modifier and Type Method Description
    void accept​(Device<Driver> device)
    Marks the Device as free for use
    void dispose()  
    Device<Driver> get()
    Acquires a Device for exclusive use

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen

    Methods inherited from interface io.webdevice.device.DeviceProvider

    initialize