Package com.microstrategy.webapi.utils
Class Scheduler<T>
- java.lang.Object
-
- com.microstrategy.webapi.utils.Scheduler<T>
-
- All Implemented Interfaces:
IScheduler<T>,java.lang.AutoCloseable
public class Scheduler<T> extends java.lang.Object implements IScheduler<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microstrategy.webapi.utils.IScheduler
IScheduler.Factory, IScheduler.ITask<T>
-
-
Constructor Summary
Constructors Constructor Description Scheduler(java.lang.String iThreadName, int iPeriodInMinutes, IScheduler.ITask<T> iTask)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()close shuts down the scheduling.java.util.ArrayList<java.util.Calendar>getNextRuns(int iNumberOfRuns)getNextRuns gets the time of the next iNumberOfRuns.static intgetSecondsSinceMidnight(java.util.Calendar iCal)voidtriggerTask(T iT)triggerTask runs a task right now (even when it is not time for the schedule).
-
-
-
Constructor Detail
-
Scheduler
public Scheduler(java.lang.String iThreadName, int iPeriodInMinutes, IScheduler.ITask<T> iTask)
-
-
Method Detail
-
getNextRuns
public java.util.ArrayList<java.util.Calendar> getNextRuns(int iNumberOfRuns)
Description copied from interface:ISchedulergetNextRuns gets the time of the next iNumberOfRuns. The times do not accout for any triggerTask() calls; it ONLY returns regularly scheduled times- Specified by:
getNextRunsin interfaceIScheduler<T>
-
triggerTask
public void triggerTask(T iT)
Description copied from interface:ISchedulertriggerTask runs a task right now (even when it is not time for the schedule). The schedule times are not affected by this task- Specified by:
triggerTaskin interfaceIScheduler<T>
-
close
public void close()
Description copied from interface:ISchedulerclose shuts down the scheduling. Any tasks currently running will continue until completion. No new tasks will be run. It waits until all currently running tasks are complete, so when this method returns you know the thread is gone- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceIScheduler<T>
-
getSecondsSinceMidnight
public static int getSecondsSinceMidnight(java.util.Calendar iCal)
-
-