Interface DriverHandler

  • All Known Implementing Classes:
    DefaultDriverHandler

    public interface DriverHandler
    Representation of context for interacting with a device.
    • Method Detail

      • driver

        Driver driver()
        Returns the parent device driver.
        Returns:
        device driver
      • data

        DriverData data()
        Returns the device driver data.
        Returns:
        device driver data
      • behaviour

        <T extends Behaviour> T behaviour​(Class<T> behaviourClass)
        Returns the specified facet of behaviour to interact with the device.
        Type Parameters:
        T - type of behaviour
        Parameters:
        behaviourClass - behaviour class
        Returns:
        behaviour
      • hasBehaviour

        default boolean hasBehaviour​(Class<? extends Behaviour> behaviourClass)
        Indicates whether or not the driver, or any of its parents, support the specified class of behaviour.
        Parameters:
        behaviourClass - behaviour class
        Returns:
        true if behaviour is supported
      • get

        <T> T get​(Class<T> serviceClass)
        Returns the reference to the implementation of the specified service. Provides access to run-time context.
        Type Parameters:
        T - type of service
        Parameters:
        serviceClass - service class
        Returns:
        service implementation
        Throws:
        ServiceNotFoundException - if service is unavailable