Given that the DeviceObserver is already being executed periodically in an ScheduledExecutorService it still does not make sense to actually execute something if no listeners are registered. As soon as the first listener is registered the execution should start. This way there will be an event for every device currently attached to the machine.
Given that the DeviceObserver is already being executed periodically in an ScheduledExecutorService it still does not make sense to actually execute something if no listeners are registered. As soon as the first listener is registered the execution should start. This way there will be an event for every device currently attached to the machine.