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
,ReadyListener
Service that manages events from udev adapter.
- Since:
- 1.0
- Version:
- 2023-08-31
-
Method Summary
Modifier and TypeMethodDescriptionvoid
claimDevice
(UdevDevice device, UdevDeviceOwner owner) Claim ownership of a device.void
releaseDevice
(UdevDevice device) Release ownership of a device.void
removeOwner
(UdevDeviceOwner owner) Release all devices claimed by the owner.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefix
Methods inherited from class com.tccc.kos.commons.util.ready.ReadyBean
getReady, onBeanReady, onDependenciesReady
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompleted
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
Methods 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.
-