Example usage for org.springframework.scheduling.support TaskUtils getDefaultErrorHandler

List of usage examples for org.springframework.scheduling.support TaskUtils getDefaultErrorHandler

Introduction

In this page you can find the example usage for org.springframework.scheduling.support TaskUtils getDefaultErrorHandler.

Prototype

public static ErrorHandler getDefaultErrorHandler(boolean isRepeatingTask) 

Source Link

Document

Return the default ErrorHandler implementation based on the boolean value indicating whether the task will be repeating or not.

Usage

From source file:be.vlaanderen.sesam.monitor.internal.util.ThreadPoolTaskScheduler.java

public ScheduledFuture schedule(Runnable task, Trigger trigger) {
    ScheduledExecutorService executor = getScheduledExecutor();
    try {/*from   w ww . ja v  a2s.  co  m*/
        ErrorHandler errorHandler = this.errorHandler != null ? this.errorHandler
                : TaskUtils.getDefaultErrorHandler(true);
        return new ReschedulingRunnable(task, trigger, executor, errorHandler).schedule();
    } catch (RejectedExecutionException ex) {
        throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
}