Package com.kosdev.kos.core.service.udev
Class UdevSubsystemMonitor
java.lang.Object
com.kosdev.kos.core.service.udev.UdevSubsystemMonitor
Systemd device subsystem monitor. This can be registered with
UdevService to monitor an
entire device subsystem. As devices are added and removed, this monitor will receive lifecycle
events- Since:
- 10
- Version:
- 10
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionUdevSubsystemMonitor(String name, String subsystem) Create a new systemd device subsystem monitor for the named subsystem. -
Method Summary
Modifier and TypeMethodDescriptionAdd a new matcher to the monitor.Return a list of devices that match this monitor.getName()voidRemove a matcher from the monitor.Set theUdevDeviceAddRemoveListenerfor the monitor.Set theUdevDeviceAvailabilityListenerfor the monitor.
-
Constructor Details
-
UdevSubsystemMonitor
Create a new systemd device subsystem monitor for the named subsystem. As this monitor will have no matchers, no devices will be exposed by this monitor. It is recommended that listeners be added before the monitor is installed. Matchers can be added before or after installation and will generate events for newly matched devices regardless.- Parameters:
name- monitor name for display purposessubsystem- the subsytsem to monitor- Since:
- 10
-
-
Method Details
-
setAddRemoveListener
Set theUdevDeviceAddRemoveListenerfor the monitor. This will receive callbacks as matching devices are added or removed from the system.- Parameters:
listener- the listener for the monitor to use- Since:
- 10
-
setAvailability
Set theUdevDeviceAvailabilityListenerfor the monitor. This will receive callbacks as matching devices change availability.- Parameters:
listener- the listener for the monitor to use- Since:
- 10
-
addMatcher
Add a new matcher to the monitor. Any devices that match this new matcher which don't match existing matchers will generate device add callbacks. This allows matchers to be added after the subsystem is already installed. -
removeMatcher
Remove a matcher from the monitor. Any devices that match this matcher which don't match remaining matchers will generate device remove callbacks. This allows matchers to be removed after the subsystem is already installed. -
getDevices
Return a list of devices that match this monitor.- Since:
- 10
-
getName
-
getSubsystem
-