public final class DelegatingSecurityContextCallable<V> extends Object implements Callable<V>
 Wraps a delegate Callable with logic for setting up a
 SecurityContext before invoking the delegate Callable and
 then removing the SecurityContext after the delegate has completed.
 
 If there is a SecurityContext that already exists, it will be
 restored after the call() method is invoked.
 
| Constructor and Description | 
|---|
| DelegatingSecurityContextCallable(Callable<V> delegate)Creates a new  DelegatingSecurityContextCallablewith theSecurityContextfrom theSecurityContextHolder. | 
| DelegatingSecurityContextCallable(Callable<V> delegate,
                                 SecurityContext securityContext)Creates a new  DelegatingSecurityContextCallablewith a specificSecurityContext. | 
| Modifier and Type | Method and Description | 
|---|---|
| V | call() | 
| static <V> Callable<V> | create(Callable<V> delegate,
      SecurityContext securityContext)Creates a  DelegatingSecurityContextCallableand with the givenCallableandSecurityContext, but if the securityContext is null will defaults to the currentSecurityContexton theSecurityContextHolder | 
| String | toString() | 
public DelegatingSecurityContextCallable(Callable<V> delegate, SecurityContext securityContext)
DelegatingSecurityContextCallable with a specific
 SecurityContext.delegate - the delegate DelegatingSecurityContextCallable to run with
 the specified SecurityContext. Cannot be null.securityContext - the SecurityContext to establish for the delegate
 Callable. Cannot be null.public DelegatingSecurityContextCallable(Callable<V> delegate)
DelegatingSecurityContextCallable with the
 SecurityContext from the SecurityContextHolder.delegate - the delegate Callable to run under the current
 SecurityContext. Cannot be null.public static <V> Callable<V> create(Callable<V> delegate, SecurityContext securityContext)
DelegatingSecurityContextCallable and with the given Callable and
 SecurityContext, but if the securityContext is null will defaults to the current SecurityContext
 on the SecurityContextHolderdelegate - the delegate DelegatingSecurityContextCallable to run with the specified
 SecurityContext. Cannot be null.securityContext - the SecurityContext to establish for the delegate Callable. If null,
 defaults to SecurityContextHolder.getContext()