org.springframework.integration.scheduling
Class SimpleTaskScheduler
java.lang.Object
org.springframework.integration.scheduling.AbstractTaskScheduler
org.springframework.integration.scheduling.SimpleTaskScheduler
- All Implemented Interfaces:
- org.springframework.beans.factory.DisposableBean, org.springframework.context.Lifecycle, org.springframework.core.task.TaskExecutor, TaskScheduler, org.springframework.scheduling.SchedulingTaskExecutor
public class SimpleTaskScheduler
- extends AbstractTaskScheduler
- implements org.springframework.beans.factory.DisposableBean
An implementation of TaskScheduler
that understands
PollingSchedules
and delegates to
a ScheduledExecutorService
instance.
- Author:
- Mark Fisher
Constructor Summary |
SimpleTaskScheduler(java.util.concurrent.ScheduledExecutorService executor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private final org.apache.commons.logging.Log logger
executor
private final java.util.concurrent.ScheduledExecutorService executor
waitForTasksToCompleteOnShutdown
private volatile boolean waitForTasksToCompleteOnShutdown
errorHandler
private volatile ErrorHandler errorHandler
pendingTasks
private final java.util.Set<java.lang.Runnable> pendingTasks
scheduledTasks
private final java.util.Map<java.lang.Runnable,java.util.concurrent.ScheduledFuture<?>> scheduledTasks
running
private volatile boolean running
lifecycleMonitor
private final java.lang.Object lifecycleMonitor
SimpleTaskScheduler
public SimpleTaskScheduler(java.util.concurrent.ScheduledExecutorService executor)
setWaitForTasksToCompleteOnShutdown
public void setWaitForTasksToCompleteOnShutdown(boolean waitForTasksToCompleteOnShutdown)
setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
- Specified by:
setErrorHandler
in interface TaskScheduler
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interface org.springframework.context.Lifecycle
start
public void start()
- Specified by:
start
in interface org.springframework.context.Lifecycle
stop
public void stop()
- Specified by:
stop
in interface org.springframework.context.Lifecycle
destroy
public void destroy()
- Specified by:
destroy
in interface org.springframework.beans.factory.DisposableBean
schedule
public java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable task)
- Specified by:
schedule
in interface TaskScheduler
- Specified by:
schedule
in class AbstractTaskScheduler
cancel
public boolean cancel(java.lang.Runnable task,
boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface TaskScheduler