Example usage for java.util.concurrent Executors unconfigurableScheduledExecutorService

List of usage examples for java.util.concurrent Executors unconfigurableScheduledExecutorService

Introduction

In this page you can find the example usage for java.util.concurrent Executors unconfigurableScheduledExecutorService.

Prototype

public static ScheduledExecutorService unconfigurableScheduledExecutorService(
        ScheduledExecutorService executor) 

Source Link

Document

Returns an object that delegates all defined ScheduledExecutorService methods to the given executor, but not any other methods that might otherwise be accessible using casts.

Usage

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

public void afterPropertiesSet() {
    if (logger.isInfoEnabled()) {
        logger.info("Initializing ScheduledExecutorService"
                + (this.beanName != null ? " '" + this.beanName + "'" : ""));
    }/*from  w  w  w. j  av a  2  s . com*/
    ScheduledExecutorService executor = createExecutor(this.poolSize, this.threadFactory,
            this.rejectedExecutionHandler);

    // Register specified ScheduledExecutorTasks, if necessary.
    if (!ObjectUtils.isEmpty(this.scheduledExecutorTasks)) {
        registerTasks(this.scheduledExecutorTasks, executor);
    }

    // Wrap executor with an unconfigurable decorator.
    this.executor = (this.exposeUnconfigurableExecutor
            ? Executors.unconfigurableScheduledExecutorService(executor)
            : executor);
}