Example usage for org.springframework.scheduling.concurrent ScheduledExecutorTask getRunnable

List of usage examples for org.springframework.scheduling.concurrent ScheduledExecutorTask getRunnable

Introduction

In this page you can find the example usage for org.springframework.scheduling.concurrent ScheduledExecutorTask getRunnable.

Prototype

public Runnable getRunnable() 

Source Link

Document

Return the Runnable to schedule as executor task.

Usage

From source file:org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean.java

/**
 * Determine the actual Runnable to schedule for the given task.
 * <p>Wraps the task's Runnable in a
 * {@link org.springframework.scheduling.support.DelegatingExceptionProofRunnable}
 * if necessary, according to the//  w  w  w .  j av a 2s .com
 * {@link #setContinueScheduledExecutionAfterException "continueScheduledExecutionAfterException"}
 * flag.
 * @param task the ScheduledExecutorTask to schedule
 * @return the actual Runnable to schedule (may be a decorator)
 */
protected Runnable getRunnableToSchedule(ScheduledExecutorTask task) {
    if (this.continueScheduledExecutionAfterException) {
        return new DelegatingExceptionProofRunnable(task.getRunnable());
    } else {
        return task.getRunnable();
    }
}