public class TraditionalBackgroundExecutor extends Object implements SpiBackgroundExecutor
| Constructor and Description |
|---|
TraditionalBackgroundExecutor(ThreadPool pool,
int schedulePoolSize,
int shutdownWaitSeconds,
String namePrefix)
Construct the default implementation of BackgroundExecutor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable r)
Execute a Runnable using a background thread.
|
void |
executePeriodically(Runnable r,
long delay,
TimeUnit unit)
Execute a task periodically with a fixed delay between each execution.
|
void |
shutdown()
Shutdown any associated thread pools.
|
public TraditionalBackgroundExecutor(ThreadPool pool, int schedulePoolSize, int shutdownWaitSeconds, String namePrefix)
public void execute(Runnable r)
execute in interface BackgroundExecutorpublic void executePeriodically(Runnable r, long delay, TimeUnit unit)
BackgroundExecutorFor example, execute a runnable every minute.
The delay is the time between executions no matter how long the task took.
That is, this method has the same behaviour characteristics as
ScheduledExecutorService.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
executePeriodically in interface BackgroundExecutorpublic void shutdown()
SpiBackgroundExecutorshutdown in interface SpiBackgroundExecutorCopyright © 2014. All Rights Reserved.