Class SofaThreadPoolTaskExecutor

java.lang.Object
org.springframework.util.CustomizableThreadCreator
org.springframework.scheduling.concurrent.CustomizableThreadFactory
org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
com.alipay.sofa.common.thread.SofaThreadPoolTaskExecutor
All Implemented Interfaces:
Serializable, Executor, ThreadFactory, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.core.task.AsyncListenableTaskExecutor, org.springframework.core.task.AsyncTaskExecutor, org.springframework.core.task.TaskExecutor, org.springframework.scheduling.SchedulingTaskExecutor

public class SofaThreadPoolTaskExecutor extends org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
Sofa thread pool based on ThreadPoolTaskExecutor
Author:
Alaneuler, huzijie Created on 2020/3/23
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected long
     
    static final String
     
     
    protected String
     
    protected long
     
    protected String
     

    Fields inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport

    logger

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

    TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
     
    long
     
     
    long
     
     
     
    protected ExecutorService
    initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
     
    void
    setPeriod(long period)
     
    void
    setSpaceName(String spaceName)
     
    void
    setTaskTimeout(long taskTimeout)
     
    void
    setThreadPoolName(String threadPoolName)
     

    Methods inherited from class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor

    cancelRemainingTask, createQueue, execute, execute, getActiveCount, getCorePoolSize, getKeepAliveSeconds, getMaxPoolSize, getPoolSize, getQueueCapacity, getQueueSize, getThreadPoolExecutor, setAllowCoreThreadTimeOut, setCorePoolSize, setKeepAliveSeconds, setMaxPoolSize, setPrestartAllCoreThreads, setQueueCapacity, setTaskDecorator, submit, submit, submitListenable, submitListenable

    Methods inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport

    afterPropertiesSet, destroy, initialize, setAwaitTerminationMillis, setAwaitTerminationSeconds, setBeanName, setRejectedExecutionHandler, setThreadFactory, setThreadNamePrefix, setWaitForTasksToCompleteOnShutdown, shutdown

    Methods inherited from class org.springframework.scheduling.concurrent.CustomizableThreadFactory

    newThread

    Methods inherited from class org.springframework.util.CustomizableThreadCreator

    createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadPriority

    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.scheduling.SchedulingTaskExecutor

    prefersShortLivedTasks
  • Field Details

    • SIMPLE_CLASS_NAME

      public static final String SIMPLE_CLASS_NAME
    • sofaThreadPoolExecutor

      protected SofaThreadPoolExecutor sofaThreadPoolExecutor
    • threadPoolName

      protected String threadPoolName
    • spaceName

      protected String spaceName
    • taskTimeout

      protected long taskTimeout
    • period

      protected long period
  • Constructor Details

    • SofaThreadPoolTaskExecutor

      public SofaThreadPoolTaskExecutor()
  • Method Details

    • initializeExecutor

      protected ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
      Overrides:
      initializeExecutor in class org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
    • createName

      protected String createName()
    • getThreadPoolName

      public String getThreadPoolName()
    • setThreadPoolName

      public void setThreadPoolName(String threadPoolName)
    • getSpaceName

      public String getSpaceName()
    • setSpaceName

      public void setSpaceName(String spaceName)
    • getTaskTimeout

      public long getTaskTimeout()
    • setTaskTimeout

      public void setTaskTimeout(long taskTimeout)
    • getPeriod

      public long getPeriod()
    • setPeriod

      public void setPeriod(long period)
    • getTimeUnit

      public TimeUnit getTimeUnit()