Skip to content
Permalink
Browse files
Merge pull request #1 from mgeiss/develop
added DelegatingSecurityContextAsyncTaskExecutor to delegate
  • Loading branch information
mgeiss committed Apr 12, 2017
2 parents c445735 + 0e4bd4c commit 723d58a90b52acfb04aa01a0dced52caaf9a6565
Showing 2 changed files with 4 additions and 1 deletion.
@@ -16,6 +16,7 @@ version '0.1.0-BUILD-SNAPSHOT'

ext.versions = [
springcontext : '4.3.3.RELEASE',
springsecurity : '4.2.2.RELEASE',
springboot : '1.4.1.RELEASE',
findbugs : '3.0.1',
]
@@ -40,6 +41,7 @@ repositories {
dependencies {
compile(
[group: 'org.springframework', name: 'spring-context', version: versions.springcontext],
[group: 'org.springframework.security', name: 'spring-security-web', version: versions.springsecurity],
[group: 'com.google.code.findbugs', name: 'jsr305', version: versions.findbugs]
)

@@ -24,6 +24,7 @@
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor;

import java.util.concurrent.Executor;

@@ -52,7 +53,7 @@ public Executor getAsyncExecutor() {
executor.setThreadNamePrefix(
this.env.getProperty(AsyncConstants.THREAD_NAME_PROP, AsyncConstants.THREAD_NAME_DEFAULT));
executor.initialize();
return executor;
return new DelegatingSecurityContextAsyncTaskExecutor(executor);
}

@Override

0 comments on commit 723d58a

Please sign in to comment.