|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.util.SchedulerHelper
public class SchedulerHelper
Encapsulates the logic which handles scheduler creation and destroy. This class is thread-safe.
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||