Class UdevService

All Implemented Interfaces:
CtxEventListener, ContextHandleAware, HandleAware, Ready, ReadyListener

public final class UdevService extends AbstractService
Service that manages events from udev adapter.
Since:
1.0
Version:
2023-08-31
  • 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.
      Parameters:
      device - the device being claimed
      owner - the object claiming ownership
      Throws:
      IllegalStateException - if device is already owned
    • 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
    • removeOwner

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