Package com.kosdev.kos.core.service.udev
Class UdevService
java.lang.Object
com.kosdev.kos.core.service.udev.UdevService
Service that manages events from udev adapter.
- Since:
- 1
- Version:
- 1
-
Method Summary
Modifier and TypeMethodDescriptionvoidclaimDevice(UdevDevice device, UdevDeviceOwner owner) Claim ownership of a device.voidreleaseDevice(UdevDevice device) Release ownership of a device.voidremoveOwner(UdevDeviceOwner owner) Release all devices claimed by the owner.
-
Method Details
-
claimDevice
Claim ownership of a device. If claimed duringonDeviceAdd()callback, the remaining listeners will still be notified. Listeners will only receiveonDeviceAvailable()callbacks until the device is owned. If no owner is provided,UdevServicewill be the owner.- Parameters:
device- the device being claimedowner- the object claiming ownership- Throws:
IllegalStateException- if device is already owned- Since:
- 1
-
releaseDevice
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
Release all devices claimed by the owner.- Since:
- 1
-