Package de.tsl2.nano.util
Class SchedulerUtil
java.lang.Object
de.tsl2.nano.util.SchedulerUtil
simple delegator to
ScheduledExecutorService.- Version:
- $Revision$
- Author:
- Tom
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final ScheduledFuture<?>runAt see {@link ScheduledExecutorService#scheduleAtFixedRate(Runnable, long, long, TimeUnit).}static final ScheduledFuture<?>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.
-
Constructor Details
-
SchedulerUtil
public SchedulerUtil()
-
-
Method Details
-
runAt
public static final 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.- Parameters:
timeOnUnit-end- end time (stopping task). if end = -1, no stopping task will be createdunit- time unitcommand- command to execute- Returns:
- future
-
runAt
public static final ScheduledFuture<?> runAt(long delay, long period, long end, TimeUnit unit, Runnable command) runAt see {@link ScheduledExecutorService#scheduleAtFixedRate(Runnable, long, long, TimeUnit).}- Parameters:
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 execute- Returns:
- future
-