public class SchedulerHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static SchedulerHelper |
create(LazyInitializer<Runnable> runnableFactory) |
static SchedulerHelper |
create(LazyInitializer<Runnable> runnableFactory,
String name)
Factory method.
|
void |
destroy()
Stops all jobs runned by the scheduler.
|
SchedulerHelper |
scheduleWithPeriod(long period)
Schedules with provided period using
TimeUnit.SECONDS as a default time unit. |
SchedulerHelper |
scheduleWithPeriod(long period,
TimeUnit timeUnit)
Run the scheduler with the provided period of time.
|
public static SchedulerHelper create(LazyInitializer<Runnable> runnableFactory, String name)
SchedulerHelper which consumes a factory providing a runnable. This approach
allows lazy runnable initialization.runnableFactory - a factory creating the runnable to schedule.name - the name associated with this SchedulerHelper (useful to detect if this class is causing a memory
leak.public static SchedulerHelper create(LazyInitializer<Runnable> runnableFactory)
SchedulerHelper#create(ObjectFactory, String)public SchedulerHelper scheduleWithPeriod(long period, TimeUnit timeUnit)
period - new period for scheduling.timeUnit - what kind of time unit is associated with the period.public SchedulerHelper scheduleWithPeriod(long period)
TimeUnit.SECONDS as a default time unit.period - new period for scheduling.public void destroy()
Copyright © 2008-2014. All Rights Reserved.