Example usage for org.springframework.scheduling.config ScheduledTaskRegistrar setScheduler

List of usage examples for org.springframework.scheduling.config ScheduledTaskRegistrar setScheduler

Introduction

In this page you can find the example usage for org.springframework.scheduling.config ScheduledTaskRegistrar setScheduler.

Prototype

public void setScheduler(@Nullable Object scheduler) 

Source Link

Document

Set the TaskScheduler to register scheduled tasks with, or a java.util.concurrent.ScheduledExecutorService to be wrapped as a TaskScheduler .

Usage

From source file:com.linkedhole.platform.infra.config.TaskConfig.java

@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
    taskRegistrar.setScheduler(taskExecutor());
}

From source file:com.thinkbiganalytics.server.KyloServerApplication.java

@Override
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
    scheduledTaskRegistrar.setScheduler(scheduledTaskExecutor());
}

From source file:io.lavagna.config.PersistenceAndServiceConfig.java

@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
    taskRegistrar.setScheduler(taskScheduler());
}

From source file:org.zalando.spring.boot.scheduling.CustomSchedulingConfiguration.java

@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
    if (properties.isEnabled()) {
        if (taskScheduler != null) {
            taskRegistrar.setScheduler(taskScheduler);
        } else {/* ww  w  .  jav a  2 s.  com*/
            throw new BeanCreationException("Expecting a 'ConcurrentTaskScheduler' injected, but was 'null'");
        }
    } else {
        log.info("'CustomSchedulingConfiguration' is disabled, create a default - 'ConcurrentTaskScheduler'");
        this.localExecutor = Executors.newSingleThreadScheduledExecutor();
        taskRegistrar.setScheduler(new ConcurrentTaskScheduler(localExecutor));
    }
}