use of org.springframework.security.concurrent.DelegatingSecurityContextScheduledExecutorService in project irida by phac-nml.
the class AnalysisExecutionServiceTestConfig method analysisTaskExecutor.
/**
* Builds a new Executor for analysis tasks.
*
* @return A new Executor for analysis tasks.
*/
@Profile({ "test", "it" })
@Bean
public Executor analysisTaskExecutor() {
ScheduledExecutorService delegateExecutor = Executors.newSingleThreadScheduledExecutor();
SecurityContext schedulerContext = createSchedulerSecurityContext();
return new DelegatingSecurityContextScheduledExecutorService(delegateExecutor, schedulerContext);
}
use of org.springframework.security.concurrent.DelegatingSecurityContextScheduledExecutorService in project irida by phac-nml.
the class IridaApiServicesConfig method analysisTaskExecutor.
/**
* Builds a new {@link Executor} for analysis tasks.
*
* @param userService
* a reference to the user service.
*
* @return A new {@link Executor} for analysis tasks.
*/
@Bean
@DependsOn("springLiquibase")
@Profile({ "prod", "dev" })
public Executor analysisTaskExecutor(UserService userService) {
ScheduledExecutorService delegateExecutor = Executors.newScheduledThreadPool(4);
SecurityContext schedulerContext = createAnalysisTaskSecurityContext(userService);
return new DelegatingSecurityContextScheduledExecutorService(delegateExecutor, schedulerContext);
}
use of org.springframework.security.concurrent.DelegatingSecurityContextScheduledExecutorService in project irida by phac-nml.
the class IridaScheduledTasksConfig method taskExecutor.
/**
* Builds a new Executor for scheduled tasks.
*
* @return A new Executor for scheduled tasks.
*/
private Executor taskExecutor() {
ScheduledExecutorService delegateExecutor = Executors.newScheduledThreadPool(threadCount);
SecurityContext schedulerContext = createSchedulerSecurityContext();
return new DelegatingSecurityContextScheduledExecutorService(delegateExecutor, schedulerContext);
}
Aggregations