org.springframework.scheduling.backportconcurrent |
Scheduling convenience classes for the
JSR-166 backport
Executor mechanism, allowing to set up a ThreadPoolExecutor or
ScheduledThreadPoolExecutor as bean in a Spring context.
|
Java Source File Name | Type | Comment |
ConcurrentTaskExecutor.java | Class | Adapter that takes a JSR-166 backport
edu.emory.mathcs.backport.java.util.concurrent.Executor and
exposes a Spring
org.springframework.core.task.TaskExecutor for it.
NOTE: This class implements Spring's
org.springframework.core.task.TaskExecutor interface as well as
the JSR-166
edu.emory.mathcs.backport.java.util.concurrent.Executor interface, with the former being the primary interface, the other just
serving as secondary convenience. |
CustomizableThreadFactory.java | Class | Implementation of the JSR-166 backport
edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory interface,
allowing for customizing the created threads (name, priority, etc). |
ScheduledExecutorFactoryBean.java | Class | org.springframework.beans.factory.FactoryBean that sets up
a JSR-166 backport
edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService (by default:
edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor as implementation) and exposes it for bean references.
Allows for registration of
ScheduledExecutorTask ScheduledExecutorTasks ,
automatically starting the
ScheduledExecutorService on initialization and
cancelling it on destruction of the context. |
ScheduledExecutorTask.java | Class | JavaBean that describes a scheduled executor task, consisting of the
Runnable and a delay plus period. |
ThreadPoolTaskExecutor.java | Class | JavaBean that allows for configuring a JSR-166 backport
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor in bean
style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity"
properties), exposing it as a Spring
org.springframework.core.task.TaskExecutor .
This is an alternative to configuring a ThreadPoolExecutor instance directly using
constructor injection, with a separate
ConcurrentTaskExecutor adapter wrapping it.
For any custom needs, in particular for defining a
edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor ,
it is recommended to use a straight definition of the Executor instance or a
factory method definition that points to the JSR-166 backport
edu.emory.mathcs.backport.java.util.concurrent.Executors class.
To expose such a raw Executor as a Spring
org.springframework.core.task.TaskExecutor ,
simply wrap it with a
ConcurrentTaskExecutor adapter.
NOTE: This class implements Spring's
org.springframework.core.task.TaskExecutor interface as well as
the JSR-166
edu.emory.mathcs.backport.java.util.concurrent.Executor interface, with the former being the primary interface, the other just
serving as secondary convenience. |