Adapter that takes a JDK 1.5
java.util.concurrent.Executor
and exposes a Spring {@link org.springframework.core.task.TaskExecutor} for it.
NOTE: This class implements Spring's {@link org.springframework.core.task.TaskExecutor} interface as well as the JDK 1.5{@link java.util.concurrent.Executor} interface, with the former being the primaryinterface, the other just serving as secondary convenience. For this reason, the exception handling follows the TaskExecutor contract rather than the Executor contract, in particular regarding the {@link org.springframework.core.task.TaskRejectedException}.
Note that there is a pre-built {@link ThreadPoolTaskExecutor} that allows fordefining a JDK 1.5 {@link java.util.concurrent.ThreadPoolExecutor} in bean style,exposing it as a Spring {@link org.springframework.core.task.TaskExecutor} directly.This is a convenient alternative to a raw ThreadPoolExecutor definition with a separate definition of the present adapter class.
@author Juergen Hoeller
@since 2.0
@see java.util.concurrent.Executor
@see java.util.concurrent.ThreadPoolExecutor
@see java.util.concurrent.Executors
@see ThreadPoolTaskExecutor