public class TaskExecutorAdapter extends Object implements AsyncTaskExecutor
java.util.concurrent.Executorand exposes a Spring
TaskExecutorfor it. Also detects an extended
java.util.concurrent.ExecutorService, adapting the
|Constructor and Description|
Create a new TaskExecutorAdapter, using the given JDK 1.5 concurrent executor.
|Modifier and Type||Method and Description|
Delegates to the specified JDK 1.5 concurrent executor.
Execute the given
Submit a Callable task for execution, receiving a Future representing that task.
Submit a Runnable task for execution, receiving a Future representing that task.
public TaskExecutorAdapter(Executor concurrentExecutor)
concurrentExecutor- the JDK 1.5 concurrent executor to delegate to
public void execute(Runnable task)
public void execute(Runnable task, long startTimeout)
Runnableto execute (never
startTimeout- the time duration (milliseconds) within which the task is supposed to start. This is intended as a hint to the executor, allowing for preferred handling of immediate tasks. Typical values are
AsyncTaskExecutor.TIMEOUT_INDEFINITE(the default as used by
nullresult upon completion.