public abstract class FixedRatePoller extends Object implements Poller
Constructor and Description |
---|
FixedRatePoller(ScheduledThreadPoolExecutor pollingExecutor,
long periodInterval)
Create a fixed rate poller using the given thread pool and with the given fixed rate period.
|
Modifier and Type | Method and Description |
---|---|
protected long |
getPeriod() |
protected Runnable |
getPollingTask() |
protected void |
setPollingTask(Runnable pollingTask) |
boolean |
start()
Starts poller
|
void |
stop()
Stops poller after finishing all started jobs
|
public FixedRatePoller(ScheduledThreadPoolExecutor pollingExecutor, long periodInterval)
pollingExecutor
- scheduled thread pool executorperiodInterval
- polling interval in millisecondspublic boolean start()
Poller
public void stop()
Poller
protected void setPollingTask(Runnable pollingTask)
protected Runnable getPollingTask()
protected long getPeriod()
Copyright © 2020 (C) Cumulocity GmbH. All rights reserved.