Class UdevService

java.lang.Object
com.kosdev.kos.core.service.udev.UdevService

public final class UdevService extends Object
Service that manages events from udev adapter.
Since:
1
Version:
1
  • Method Details

    • claimDevice

      public void claimDevice(UdevDevice device, UdevDeviceOwner owner)
      Claim ownership of a device. If claimed during onDeviceAdd() callback, the remaining listeners will still be notified. Listeners will only receive onDeviceAvailable() callbacks until the device is owned. If no owner is provided, UdevService will be the owner.
      Parameters:
      device - the device being claimed
      owner - the object claiming ownership
      Throws:
      IllegalStateException - if device is already owned
      Since:
      1
    • releaseDevice

      public void releaseDevice(UdevDevice device)
      Release ownership of a device. This will cause all listeners to be notified that the device is available.
      Parameters:
      device - the device to release
      Since:
      1
    • removeOwner

      public void removeOwner(UdevDeviceOwner owner)
      Release all devices claimed by the owner.
      Since:
      1