public class SchedulerUtil extends Object
ScheduledExecutorService.| Constructor and Description |
|---|
SchedulerUtil() |
| Modifier and Type | Method and Description |
|---|---|
static ScheduledFuture<?> |
runAt(long delay,
long period,
long end,
TimeUnit unit,
Runnable command)
|
static ScheduledFuture<?> |
runAt(long timeOnUnit,
long end,
TimeUnit unit,
Runnable command)
runs the given command at given time on given unit. example: timeOnUnit=2*60*60*1000, unit=TimeUnit.DAY -->
command will be started each day at 2 o'clock.
|
public static final ScheduledFuture<?> runAt(long timeOnUnit, long end, TimeUnit unit, Runnable command)
timeOnUnit - end - end time (stopping task). if end = -1, no stopping task will be createdunit - time unitcommand - command to executepublic static final ScheduledFuture<?> runAt(long delay, long period, long end, TimeUnit unit, Runnable command)
delay - wait time for first startperiod - period timeend - end time (stopping task). if end = -1, no stopping task will be createdunit - time unitcommand - command to executeCopyright © 2012–2018. All rights reserved.