Package org.springframework.security.concurrent

# Class DelegatingSecurityContextScheduledExecutorService

java.lang.Object
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
org.springframework.security.concurrent.DelegatingSecurityContextExecutorService
org.springframework.security.concurrent.DelegatingSecurityContextScheduledExecutorService

All Implemented Interfaces:
  `Executor`, `ExecutorService`, `ScheduledExecutorService`

public final class DelegatingSecurityContextScheduledExecutorService extends DelegatingSecurityContextExecutorService implements ScheduledExecutorService
An `ScheduledExecutorService` which wraps each `Runnable` in a `DelegatingSecurityContextRunnable` and each `Callable` in a `DelegatingSecurityContextCallable`.

Since:
  3.2

## Constructor Summary

Constructors
Constructor
Description
`DelegatingSecurityContextScheduledExecutorService(ScheduledExecutorService delegate)`
Creates a new `DelegatingSecurityContextScheduledExecutorService` that uses the current `SecurityContext` from the `SecurityContextHolder`.
`DelegatingSecurityContextScheduledExecutorService(ScheduledExecutorService delegateScheduledExecutorService, SecurityContext securityContext)`
Creates a new `DelegatingSecurityContextScheduledExecutorService` that uses the specified `SecurityContext`.

## Method Summary

Modifier and Type
Method
Description
`ScheduledFuture<?>`
`schedule(Runnable command, long delay, TimeUnit unit)`
`<V> ScheduledFuture<V>`
`schedule(Callable<V> callable, long delay, TimeUnit unit)`
`ScheduledFuture<?>`
`scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)`
`ScheduledFuture<?>`
`scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)`
`protected final Runnable`
`wrap(Runnable delegate)`
`protected final <T> Callable<T>`
`wrap(Callable<T> delegate)`

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

`awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit`

### 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 java.util.concurrent.Executor

`execute`

### Methods inherited from interface java.util.concurrent.ExecutorService

`awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit`

## Constructor Details

### DelegatingSecurityContextScheduledExecutorService

public DelegatingSecurityContextScheduledExecutorService(ScheduledExecutorService delegateScheduledExecutorService, SecurityContext securityContext)
Creates a new `DelegatingSecurityContextScheduledExecutorService` that uses the specified `SecurityContext`.

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

### DelegatingSecurityContextScheduledExecutorService

public DelegatingSecurityContextScheduledExecutorService(ScheduledExecutorService delegate)
Creates a new `DelegatingSecurityContextScheduledExecutorService` that uses the current `SecurityContext` from the `SecurityContextHolder`.

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

## Method Details

### schedule

public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)

Specified by:
  `schedule` in interface `ScheduledExecutorService`

### schedule

public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)

Specified by:
  `schedule` in interface `ScheduledExecutorService`

### scheduleAtFixedRate

public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)

Specified by:
  `scheduleAtFixedRate` in interface `ScheduledExecutorService`

### scheduleWithFixedDelay

public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)

Specified by:
  `scheduleWithFixedDelay` in interface `ScheduledExecutorService`

### wrap

protected final Runnable wrap(Runnable delegate)

### wrap

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