Package org.springframework.security.task

# Class DelegatingSecurityContextTaskExecutor

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

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

Direct Known Subclasses:
  `DelegatingSecurityContextAsyncTaskExecutor`

public class DelegatingSecurityContextTaskExecutor extends DelegatingSecurityContextExecutor implements org.springframework.core.task.TaskExecutor
An `TaskExecutor` which wraps each `Runnable` in a `DelegatingSecurityContextRunnable`.

Since:
  3.2

## Constructor Summary

Constructors
Constructor
Description
`DelegatingSecurityContextTaskExecutor(org.springframework.core.task.TaskExecutor delegate)`
Creates a new `DelegatingSecurityContextTaskExecutor` that uses the current `SecurityContext` from the `SecurityContextHolder`.
`DelegatingSecurityContextTaskExecutor(org.springframework.core.task.TaskExecutor delegateTaskExecutor, SecurityContext securityContext)`
Creates a new `DelegatingSecurityContextTaskExecutor` that uses the specified `SecurityContext`.

## Method Summary

Modifier and Type
Method
Description
`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.TaskExecutor

`execute`

## Constructor Details

### DelegatingSecurityContextTaskExecutor

public DelegatingSecurityContextTaskExecutor(org.springframework.core.task.TaskExecutor delegateTaskExecutor, SecurityContext securityContext)
Creates a new `DelegatingSecurityContextTaskExecutor` that uses the specified `SecurityContext`.

Parameters:
  `delegateTaskExecutor` - the `TaskExecutor` to delegate to. Cannot be null.
  `securityContext` - the `SecurityContext` to use for each `DelegatingSecurityContextRunnable`

### DelegatingSecurityContextTaskExecutor

public DelegatingSecurityContextTaskExecutor(org.springframework.core.task.TaskExecutor delegate)
Creates a new `DelegatingSecurityContextTaskExecutor` that uses the current `SecurityContext` from the `SecurityContextHolder`.

Parameters:
  `delegate` - the `TaskExecutor` to delegate to. Cannot be null.

## Method Details

### wrap

protected final Runnable wrap(Runnable delegate)

### wrap

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