| java.lang.Object org.springframework.util.CustomizableThreadCreator org.springframework.core.task.SimpleAsyncTaskExecutor
Field Summary | |
final public static String | DEFAULT_THREAD_NAME_PREFIX Default thread name prefix: "SimpleAsyncTaskExecutor-". | final public static int | NO_CONCURRENCY Switch concurrency 'off': that is, don't allow any concurrent invocations. | final public static int | UNBOUNDED_CONCURRENCY Permit any number of concurrent invocations: that is, don't throttle concurrency. |
Method Summary | |
protected void | doExecute(Runnable task) Template method for the actual execution of a task. | public void | execute(Runnable task) Executes the given task, within a concurrency throttle
if configured (through the superclass's settings). | public void | execute(Runnable task, long startTimeout) Executes the given task, within a concurrency throttle
if configured (through the superclass's settings).
Executes urgent tasks (with 'immediate' timeout) directly,
bypassing the concurrency throttle (if active). | public int | getConcurrencyLimit() Return the maximum number of parallel accesses allowed. | public boolean | isThrottleActive() Return whether this throttle is currently active. | public void | setConcurrencyLimit(int concurrencyLimit) Set the maximum number of parallel accesses allowed. |
DEFAULT_THREAD_NAME_PREFIX | final public static String DEFAULT_THREAD_NAME_PREFIX(Code) | | Default thread name prefix: "SimpleAsyncTaskExecutor-".
|
NO_CONCURRENCY | final public static int NO_CONCURRENCY(Code) | | Switch concurrency 'off': that is, don't allow any concurrent invocations.
|
UNBOUNDED_CONCURRENCY | final public static int UNBOUNDED_CONCURRENCY(Code) | | Permit any number of concurrent invocations: that is, don't throttle concurrency.
|
SimpleAsyncTaskExecutor | public SimpleAsyncTaskExecutor()(Code) | | Create a new SimpleAsyncTaskExecutor with default thread name prefix.
|
SimpleAsyncTaskExecutor | public SimpleAsyncTaskExecutor(String threadNamePrefix)(Code) | | Create a new SimpleAsyncTaskExecutor with the given thread name prefix.
Parameters: threadNamePrefix - the prefix to use for the names of newly created threads |
getConcurrencyLimit | public int getConcurrencyLimit()(Code) | | Return the maximum number of parallel accesses allowed.
|
setConcurrencyLimit | public void setConcurrencyLimit(int concurrencyLimit)(Code) | | Set the maximum number of parallel accesses allowed.
-1 indicates no concurrency limit at all.
In principle, this limit can be changed at runtime,
although it is generally designed as a config time setting.
NOTE: Do not switch between -1 and any concrete limit at runtime,
as this will lead to inconsistent concurrency counts: A limit
of -1 effectively turns off concurrency counting completely.
See Also: SimpleAsyncTaskExecutor.UNBOUNDED_CONCURRENCY |
|
|