Class DelegatingSecurityContextSchedulingTaskExecutor

java.lang.Object
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
org.springframework.security.task.DelegatingSecurityContextTaskExecutor
org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor
org.springframework.security.scheduling.DelegatingSecurityContextSchedulingTaskExecutor
ubic.gemma.core.security.concurrent.DelegatingSecurityContextSchedulingTaskExecutor
All Implemented Interfaces:
Executor, EventListener, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>, org.springframework.core.task.AsyncTaskExecutor, org.springframework.core.task.TaskExecutor, org.springframework.scheduling.SchedulingTaskExecutor, DelegatingAsyncTaskExecutor, DelegatingSchedulingTaskExecutor, DelegatingTaskExecutor

public class DelegatingSecurityContextSchedulingTaskExecutor extends org.springframework.security.scheduling.DelegatingSecurityContextSchedulingTaskExecutor implements DelegatingSchedulingTaskExecutor, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>
  • Field Summary

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

    TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
  • Constructor Summary

    Constructors
    Constructor
    Description
    DelegatingSecurityContextSchedulingTaskExecutor(org.springframework.scheduling.SchedulingTaskExecutor delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.scheduling.SchedulingTaskExecutor
    The task executor this is delegating for.
    void
    onApplicationEvent(org.springframework.context.event.ContextClosedEvent event)
    Spring's pool-backed executors (ExecutorConfigurationSupport, the base of ThreadPoolTaskExecutor/ThreadPoolTaskScheduler) shut their thread pool down on ContextClosedEvent by implementing ApplicationListener.
    protected final Runnable
    wrap(Runnable arg0)
     
    protected final <T> Callable<T>
    wrap(Callable<T> arg0)
     

    Methods inherited from class org.springframework.security.scheduling.DelegatingSecurityContextSchedulingTaskExecutor

    prefersShortLivedTasks

    Methods inherited from class org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor

    execute, submit, submit

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

    execute, getDelegateExecutor, setSecurityContextHolderStrategy

    Methods inherited from class Object

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

    Methods inherited from interface org.springframework.context.ApplicationListener

    supportsAsyncExecution

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

    execute, submit, submit, submitCompletable, submitCompletable

    Methods inherited from interface org.springframework.scheduling.SchedulingTaskExecutor

    prefersShortLivedTasks

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

    execute
  • Constructor Details

    • DelegatingSecurityContextSchedulingTaskExecutor

      public DelegatingSecurityContextSchedulingTaskExecutor(org.springframework.scheduling.SchedulingTaskExecutor delegate)
  • Method Details

    • getDelegate

      public org.springframework.scheduling.SchedulingTaskExecutor getDelegate()
      Description copied from interface: DelegatingAsyncTaskExecutor
      The task executor this is delegating for.
      Specified by:
      getDelegate in interface DelegatingAsyncTaskExecutor
      Specified by:
      getDelegate in interface DelegatingSchedulingTaskExecutor
      Specified by:
      getDelegate in interface DelegatingTaskExecutor
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.context.event.ContextClosedEvent event)
      Spring's pool-backed executors (ExecutorConfigurationSupport, the base of ThreadPoolTaskExecutor/ThreadPoolTaskScheduler) shut their thread pool down on ContextClosedEvent by implementing ApplicationListener. Wrapping such a bean hid that interface, which both dropped the context-close shutdown propagation and made the event multicaster throw BeanNotOfRequiredTypeException at shutdown — the bean was registered as a listener by its pre-wrapping type but resolved to this wrapper, which was not an ApplicationListener. Re-expose the contract and forward the event so both are restored; a no-op when the delegate is not itself a listener.
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>
    • wrap

      protected final Runnable wrap(Runnable arg0)
    • wrap

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