Summer.Batch.Common.TaskExecution.SimpleAsyncTaskExecutor Class Reference

ITaskExecutor asynchronous implementation. Supports limiting concurrent threads through the "concurrencyLimit" bean property. By default, the number of concurrent threads is unlimited. NOTE: This implementation does not reuse threads! Consider a thread-pooling TaskExecutor implementation instead, in particular for executing a large number of short-lived tasks. More...

Inheritance diagram for Summer.Batch.Common.TaskExecution.SimpleAsyncTaskExecutor:
Summer.Batch.Common.TaskExecution.IAsyncTaskExecutor Summer.Batch.Common.TaskExecution.ITaskExecutor

Public Member Functions

bool IsThrottleActive ()
 Return whether owned throttle is currently active. More...
 
void Execute (Task task, long startTimeout)
 Executes the given task. More...
 
void Submit (Task task)
 Submits a task for execution. More...
 
void Execute (Task task)
 Executes the given task. The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution. More...
 

Protected Member Functions

void DoExecute (Task task)
 Template method for the actual execution of a task. The default implementation starts the task. More...
 

Detailed Description

ITaskExecutor asynchronous implementation. Supports limiting concurrent threads through the "concurrencyLimit" bean property. By default, the number of concurrent threads is unlimited. NOTE: This implementation does not reuse threads! Consider a thread-pooling TaskExecutor implementation instead, in particular for executing a large number of short-lived tasks.

Member Function Documentation

void Summer.Batch.Common.TaskExecution.SimpleAsyncTaskExecutor.DoExecute ( Task  task)
protected

Template method for the actual execution of a task. The default implementation starts the task.

Parameters
taskThe task to execute.
void Summer.Batch.Common.TaskExecution.SimpleAsyncTaskExecutor.Execute ( Task  task,
long  startTimeout 
)

Executes the given task.

Parameters
taskThe task to execute.
startTimeoutThe time duration ( inmilliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks.
Exceptions
TaskRejectedException 
TaskTimeoutException in case of the task being rejected because of the timeout (i.e. it cannot be started in time)
See also
AsyncTaskExecutorConstants.TimeoutImmediate, AsyncTaskExecutorConstants.TimeoutIndefinite

Implements Summer.Batch.Common.TaskExecution.IAsyncTaskExecutor.

void Summer.Batch.Common.TaskExecution.SimpleAsyncTaskExecutor.Execute ( Task  task)

Executes the given task. The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Parameters
taskthe Task to execute (never null).
Exceptions
TaskRejectedException If the given task was not accepted.

Implements Summer.Batch.Common.TaskExecution.ITaskExecutor.

bool Summer.Batch.Common.TaskExecution.SimpleAsyncTaskExecutor.IsThrottleActive ( )

Return whether owned throttle is currently active.

Returns
void Summer.Batch.Common.TaskExecution.SimpleAsyncTaskExecutor.Submit ( Task  task)

Submits a task for execution.

Parameters
taskThe task to execute.
Exceptions
TaskRejectedException If the given task was not accepted.

Implements Summer.Batch.Common.TaskExecution.IAsyncTaskExecutor.


The documentation for this class was generated from the following file:
  • Summer.Batch.Common/TaskExecution/SimpleAsyncTaskExecutor.cs