public class SdkTaskSchedulerImpl extends Object implements SdkTaskScheduler
Constructor and Description |
---|
SdkTaskSchedulerImpl(ScheduledExecutorService scheduler,
SdkInternalConfiguration sdkInternalConfiguration)
Constructs a new sdk task scheduler
|
Modifier and Type | Method and Description |
---|---|
void |
open()
Opens the SDK task scheduler and starts all the scheduled tasks
|
void |
scheduleAtFixedRate(String name,
Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Schedules a repeating task.
|
void |
shutdownNow()
Shuts down all the scheduled tasks
|
void |
startOneTimeTask(String name,
Runnable command)
Creates and executes a one-shot action
|
public SdkTaskSchedulerImpl(ScheduledExecutorService scheduler, SdkInternalConfiguration sdkInternalConfiguration)
scheduler
- the actual ScheduledExecutorService
instance which will be used to schedule taskssdkInternalConfiguration
- the internal SDK configurationpublic void open()
open
in interface SdkTaskScheduler
public void shutdownNow()
shutdownNow
in interface SdkTaskScheduler
public void scheduleAtFixedRate(String name, Runnable command, long initialDelay, long period, TimeUnit unit)
open()
scheduleAtFixedRate
in interface SdkTaskScheduler
name
- the associated task namecommand
- see ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
initialDelay
- see ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
period
- see ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
unit
- see ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
public void startOneTimeTask(String name, Runnable command)
startOneTimeTask
in interface SdkTaskScheduler
name
- the name of the taskcommand
- the task to executeCopyright © 2016–2025. All rights reserved.