Example usage for org.springframework.security.concurrent DelegatingSecurityContextScheduledExecutorService DelegatingSecurityContextScheduledExecutorService

List of usage examples for org.springframework.security.concurrent DelegatingSecurityContextScheduledExecutorService DelegatingSecurityContextScheduledExecutorService

Introduction

In this page you can find the example usage for org.springframework.security.concurrent DelegatingSecurityContextScheduledExecutorService DelegatingSecurityContextScheduledExecutorService.

Prototype

public DelegatingSecurityContextScheduledExecutorService(ScheduledExecutorService delegate) 

Source Link

Document

Creates a new DelegatingSecurityContextScheduledExecutorService that uses the current SecurityContext from the SecurityContextHolder .

Usage

From source file:at.ac.univie.isc.asio.Asio.java

@Bean(destroyMethod = "shutdown")
public ScheduledExecutorService workerPool() {
    final ThreadFactory factory = new ThreadFactoryBuilder().setNameFormat("asio-worker-%d").build();
    final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(factory);
    final DelegatingSecurityContextScheduledExecutorService secured = new DelegatingSecurityContextScheduledExecutorService(
            executor);//from w w  w  . java 2  s  .  c o m
    return secured;
}