public GpioEventMonitorExecutorImpl(GpioPinInput pin) { this.pin = pin; executor = GpioFactory.getExecutorServiceFactory().getGpioEventExecutorService(); scheduledExecutor = GpioFactory.getExecutorServiceFactory().getScheduledExecutorService(); }
public GpioEventDebounceTaskImpl(GpioPinDigitalInput pin, PinState state) { executor = GpioFactory.getExecutorServiceFactory().getGpioEventExecutorService(); this.originalPinState = state; this.pin = pin; }
public GpioEventDebounceTaskImpl(GpioPinDigitalInput pin, PinState state) { executor = GpioFactory.getExecutorServiceFactory().getGpioEventExecutorService(); this.originalPinState = state; this.pin = pin; }
public GpioEventMonitorExecutorImpl(GpioPinInput pin) { this.pin = pin; executor = GpioFactory.getExecutorServiceFactory().getGpioEventExecutorService(); scheduledExecutor = GpioFactory.getExecutorServiceFactory().getScheduledExecutorService(); }
private synchronized static void init(GpioPinDigitalOutput pin) { if (scheduledExecutorService == null) { scheduledExecutorService = GpioFactory.getExecutorServiceFactory().getScheduledExecutorService(); } // determine if any existing future tasks are already scheduled for this pin if (pinTaskQueue.containsKey(pin)) { // if a task is found, then cancel all pending tasks immediately and remove them ArrayList<ScheduledFuture<?>> tasks = pinTaskQueue.get(pin); if (tasks != null && !tasks.isEmpty()) { for (int index = (tasks.size() - 1); index >= 0; index--) { ScheduledFuture<?> task = tasks.get(index); task.cancel(true); tasks.remove(index); } } // if no remaining future tasks are remaining, then remove this pin from the tasks queue if (tasks != null && tasks.isEmpty()) { pinTaskQueue.remove(pin); } } }
private synchronized static void init(GpioPinDigitalOutput pin) { if (scheduledExecutorService == null) { scheduledExecutorService = GpioFactory.getExecutorServiceFactory().getScheduledExecutorService(); } // determine if any existing future tasks are already scheduled for this pin if (pinTaskQueue.containsKey(pin)) { // if a task is found, then cancel all pending tasks immediately and remove them ArrayList<ScheduledFuture<?>> tasks = pinTaskQueue.get(pin); if (tasks != null && !tasks.isEmpty()) { for (int index = (tasks.size() - 1); index >= 0; index--) { ScheduledFuture<?> task = tasks.get(index); task.cancel(true); tasks.remove(index); } } // if no remaining future tasks are remaining, then remove this pin from the tasks queue if (tasks != null && tasks.isEmpty()) { pinTaskQueue.remove(pin); } } }
GpioFactory.getExecutorServiceFactory().shutdown();
GpioFactory.getExecutorServiceFactory().shutdown();