Interface DriverHandler

  • All Known Implementing Classes:
    DefaultDriverHandler

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

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      <T extends Behaviour>
      T
      behaviour​(java.lang.Class<T> behaviourClass)
      Returns the specified facet of behaviour to interact with the device.
      DriverData data()
      Returns the device driver data.
      Driver driver()
      Returns the parent device driver.
      <T> T get​(java.lang.Class<T> serviceClass)
      Returns the reference to the implementation of the specified service.
      default boolean hasBehaviour​(java.lang.Class<? extends Behaviour> behaviourClass)
      Indicates whether or not the driver, or any of its parents, support the specified class of behaviour.
    • 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​(java.lang.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​(java.lang.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​(java.lang.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