Package org.springframework.security.task

# Class DelegatingSecurityContextAsyncTaskExecutor

java.lang.Object
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
org.springframework.security.task.DelegatingSecurityContextTaskExecutor
org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor

All Implemented Interfaces:
  `Executor`, `org.springframework.core.task.AsyncTaskExecutor`, `org.springframework.core.task.TaskExecutor`

Direct Known Subclasses:
  `DelegatingSecurityContextSchedulingTaskExecutor`

public class DelegatingSecurityContextAsyncTaskExecutor extends DelegatingSecurityContextTaskExecutor implements org.springframework.core.task.AsyncTaskExecutor
An `AsyncTaskExecutor` which wraps each `Runnable` in a `DelegatingSecurityContextRunnable` and each `Callable` in a `DelegatingSecurityContextCallable`.

Since:
  3.2

## Field Summary

### Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor

`TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE`

## Constructor Summary

Constructors
Constructor
Description
`DelegatingSecurityContextAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor delegateAsyncTaskExecutor)`
Creates a new `DelegatingSecurityContextAsyncTaskExecutor` that uses the current `SecurityContext`.
`DelegatingSecurityContextAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor delegateAsyncTaskExecutor, SecurityContext securityContext)`
Creates a new `DelegatingSecurityContextAsyncTaskExecutor` that uses the specified `SecurityContext`.

## Method Summary

Modifier and Type
Method
Description
`final void`
`execute(Runnable task, long startTimeout)`
`final Future<?>`
`submit(Runnable task)`
`final <T> Future<T>`
`submit(Callable<T> task)`
`protected final Runnable`
`wrap(Runnable delegate)`
`protected final <T> Callable<T>`
`wrap(Callable<T> delegate)`

### Methods inherited from class org.springframework.security.concurrent.DelegatingSecurityContextExecutor

`execute, getDelegateExecutor, setSecurityContextHolderStrategy`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.core.task.AsyncTaskExecutor

`submitCompletable, submitCompletable`

### Methods inherited from interface org.springframework.core.task.TaskExecutor

`execute`

## Constructor Details

### DelegatingSecurityContextAsyncTaskExecutor

public DelegatingSecurityContextAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor delegateAsyncTaskExecutor, SecurityContext securityContext)
Creates a new `DelegatingSecurityContextAsyncTaskExecutor` that uses the specified `SecurityContext`.

Parameters:
  `delegateAsyncTaskExecutor` - the `AsyncTaskExecutor` to delegate to. Cannot be null.
  `securityContext` - the `SecurityContext` to use for each `DelegatingSecurityContextRunnable` and `DelegatingSecurityContextCallable`

### DelegatingSecurityContextAsyncTaskExecutor

public DelegatingSecurityContextAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor delegateAsyncTaskExecutor)
Creates a new `DelegatingSecurityContextAsyncTaskExecutor` that uses the current `SecurityContext`.

Parameters:
  `delegateAsyncTaskExecutor` - the `AsyncTaskExecutor` to delegate to. Cannot be null.

## Method Details

### execute

public final void execute(Runnable task, long startTimeout)

Specified by:
  `execute` in interface `org.springframework.core.task.AsyncTaskExecutor`

### submit

public final Future<?> submit(Runnable task)

Specified by:
  `submit` in interface `org.springframework.core.task.AsyncTaskExecutor`

### submit

public final <T> Future<T> submit(Callable<T> task)

Specified by:
  `submit` in interface `org.springframework.core.task.AsyncTaskExecutor`

### wrap

protected final Runnable wrap(Runnable delegate)

### wrap

protected final <T> Callable<T> wrap(Callable<T> delegate)