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 void
close()
close shuts down the scheduling.java.util.ArrayList<java.util.Calendar>
getNextRuns(int iNumberOfRuns)
getNextRuns gets the time of the next iNumberOfRuns.static int
getSecondsSinceMidnight(java.util.Calendar iCal)
void
triggerTask(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:IScheduler
getNextRuns gets the time of the next iNumberOfRuns. The times do not accout for any triggerTask() calls; it ONLY returns regularly scheduled times- Specified by:
getNextRuns
in interfaceIScheduler<T>
-
triggerTask
public void triggerTask(T iT)
Description copied from interface:IScheduler
triggerTask 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:
triggerTask
in interfaceIScheduler<T>
-
close
public void close()
Description copied from interface:IScheduler
close 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceIScheduler<T>
-
getSecondsSinceMidnight
public static int getSecondsSinceMidnight(java.util.Calendar iCal)
-
-