com.atlassian.plugin.osgi.spring
Class ThreadPoolAsyncTaskExecutor
java.lang.Object
com.atlassian.plugin.osgi.spring.ThreadPoolAsyncTaskExecutor
- All Implemented Interfaces:
- java.util.concurrent.Executor, org.springframework.core.task.AsyncTaskExecutor, org.springframework.core.task.TaskExecutor
public class ThreadPoolAsyncTaskExecutor
- extends java.lang.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
| Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor |
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE |
|
Method Summary |
void |
execute(java.lang.Runnable task)
Executes the runnable |
void |
execute(java.lang.Runnable task,
long startTimeout)
Executes the runnable |
void |
shutdown()
Shuts down the internal ExecutorService to ensure that all threads are stopped in order to allow the JVM
to terminate cleanly in a timely fashion. |
<T> java.util.concurrent.Future<T> |
|
submit(java.util.concurrent.Callable<T> task)
|
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadPoolAsyncTaskExecutor
public ThreadPoolAsyncTaskExecutor()
execute
public void execute(java.lang.Runnable task,
long startTimeout)
- Executes the runnable
- Specified by:
execute in interface org.springframework.core.task.AsyncTaskExecutor
- Parameters:
task - The runnable taskstartTimeout - The start timeout (ignored)
submit
public java.util.concurrent.Future<?> submit(java.lang.Runnable task)
- Specified by:
submit in interface org.springframework.core.task.AsyncTaskExecutor
submit
public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
- Specified by:
submit in interface org.springframework.core.task.AsyncTaskExecutor
execute
public void execute(java.lang.Runnable task)
- Executes the runnable
- Specified by:
execute in interface java.util.concurrent.Executor- Specified by:
execute in interface org.springframework.core.task.TaskExecutor
- Parameters:
task - The runnable task
shutdown
public void shutdown()
- Shuts down the internal
ExecutorService to ensure that all threads are stopped in order to allow the JVM
to terminate cleanly in a timely fashion.
Copyright © 2013 Atlassian. All Rights Reserved.