Package com.atlassian.plugin.osgi.spring
Class ThreadPoolAsyncTaskExecutor
java.lang.Object
com.atlassian.plugin.osgi.spring.ThreadPoolAsyncTaskExecutor
- All Implemented Interfaces:
Executor,org.springframework.core.task.AsyncTaskExecutor,org.springframework.core.task.TaskExecutor
public class ThreadPoolAsyncTaskExecutor
extends Object
implements org.springframework.core.task.AsyncTaskExecutor
Executes spring tasks using a cached thread pool that expands as necessary. Overrides the default Spring executor
that spawns a new thread for every application context creation.
- Since:
- 2.5.0
-
Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ThreadPoolAsyncTaskExecutor
public ThreadPoolAsyncTaskExecutor()
-
-
Method Details
-
execute
Executes the runnable- Specified by:
executein interfaceorg.springframework.core.task.AsyncTaskExecutor- Parameters:
task- The runnable taskstartTimeout- The start timeout (ignored)
-
submit
- Specified by:
submitin interfaceorg.springframework.core.task.AsyncTaskExecutor
-
submit
- Specified by:
submitin interfaceorg.springframework.core.task.AsyncTaskExecutor
-
execute
Executes the runnable -
shutdown
public void shutdown()Shuts down the internalExecutorServiceto ensure that all threads are stopped in order to allow the JVM to terminate cleanly in a timely fashion.
-