Package com.tccc.kos.core.service.udev
Class UdevService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.core.service.udev.UdevService
- All Implemented Interfaces:
CtxEventListener,ContextHandleAware,HandleAware,Ready,ReadyAndReadyListener,ReadyListener
Service that manages events from udev adapter.
- Since:
- 1.0
- Version:
- 2023-08-31
-
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.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefixMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompletedMethods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPathMethods inherited from interface com.tccc.kos.commons.util.ready.ReadyAndReadyListener
onBeanReady, onDependenciesReadyMethods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
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.- Parameters:
device- the device being claimedowner- the object claiming ownership- Throws:
IllegalStateException- if device is already owned
-
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
-
removeOwner
Release all devices claimed by the owner.
-