Package com.alipay.sofa.common.thread
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
Modifier and TypeFieldDescriptionprotected long
static final String
protected SofaThreadPoolExecutor
protected boolean
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
long
long
protected ExecutorService
initializeExecutor
(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) boolean
void
setPeriod
(long period) void
setSofaTracerTransmit
(boolean sofaTracerTransmit) 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
-
sofaThreadPoolExecutor
-
threadPoolName
-
spaceName
-
taskTimeout
protected long taskTimeout -
period
protected long period -
sofaTracerTransmit
protected boolean sofaTracerTransmit
-
-
Constructor Details
-
SofaThreadPoolTaskExecutor
public SofaThreadPoolTaskExecutor()
-
-
Method Details
-
initializeExecutor
protected ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) - Overrides:
initializeExecutor
in classorg.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
-
createName
-
getThreadPoolName
-
setThreadPoolName
-
getSpaceName
-
setSpaceName
-
getTaskTimeout
public long getTaskTimeout() -
setTaskTimeout
public void setTaskTimeout(long taskTimeout) -
getPeriod
public long getPeriod() -
setPeriod
public void setPeriod(long period) -
getTimeUnit
-
isSofaTracerTransmit
public boolean isSofaTracerTransmit() -
setSofaTracerTransmit
public void setSofaTracerTransmit(boolean sofaTracerTransmit)
-