public class ConfigurationScheduler extends AbstractLifeCycle
LifeCycle.State
Constructor and Description |
---|
ConfigurationScheduler() |
Modifier and Type | Method and Description |
---|---|
void |
decrementScheduledItems()
Decrement the number of threads in the pool
|
void |
incrementScheduledItems()
Increment the number of threads in the pool.
|
<V> ScheduledFuture<V> |
schedule(Callable<V> callable,
long delay,
TimeUnit unit)
Creates and executes a ScheduledFuture that becomes enabled after the given delay.
|
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay.
|
ScheduledFuture<?> |
scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently
with the given period; that is executions will commence after initialDelay then initialDelay+period,
then initialDelay + 2 * period, and so on.
|
CronScheduledFuture<?> |
scheduleWithCron(CronExpression cronExpression,
Runnable command)
Creates and executes an action that first based on a cron expression.
|
ScheduledFuture<?> |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and
subsequently with the given delay between the termination of one execution and the commencement of the next.
|
void |
start() |
void |
stop() |
equalsImpl, getState, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping
public void start()
start
in interface LifeCycle
start
in class AbstractLifeCycle
public void stop()
stop
in interface LifeCycle
stop
in class AbstractLifeCycle
public void incrementScheduledItems()
public void decrementScheduledItems()
public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
callable
- the function to execute.delay
- the time from now to delay execution.unit
- the time unit of the delay parameter.public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
command
- the task to execute.delay
- the time from now to delay execution.unit
- the time unit of the delay parameter.public CronScheduledFuture<?> scheduleWithCron(CronExpression cronExpression, Runnable command)
cronExpression
- the cron expression describing the schedule.command
- The Runnable to run,public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
command
- the task to execute.initialDelay
- the time to delay first execution.period
- the period between successive executions.unit
- the time unit of the initialDelay and period parameters.public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
command
- the task to execute.initialDelay
- the time to delay first execution.delay
- the delay between the termination of one execution and the commencement of the next.unit
- the time unit of the initialDelay and delay parametersCopyright © 1999-2017 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.