java.lang.Object | |
↳ | org.springframework.jca.work.SimpleTaskWorkManager |
Simple JCA 1.5 javax.resource.spi.work.WorkManager implementation that
delegates to a Spring TaskExecutor
.
Provides simple task execution including start timeouts, but without support
for a JCA ExecutionContext (i.e. without support for imported transactions).
Uses a SyncTaskExecutor
for doWork(Work)
calls and a SimpleAsyncTaskExecutor
for startWork(Work)
and scheduleWork(Work)
calls, by default.
These default task executors can be overridden through configuration.
NOTE: This WorkManager does not provide thread pooling by default!
Specify a ThreadPoolTaskExecutor
(or any other thread-pooling TaskExecutor) as "asyncTaskExecutor" in order to
achieve actual thread pooling.
This WorkManager automatically detects a specified
AsyncTaskExecutor
implementation
and uses its extended timeout functionality where appropriate.
JCA WorkListeners are fully supported in any case.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Specify the TaskExecutor to use for asynchronous work execution
(i.e.
| |||||||||||
Specify the TaskExecutor to use for synchronous work execution
(i.e.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Execute the given Work on the specified TaskExecutor.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
WorkException |
---|
WorkException |
---|
WorkException |
---|
WorkException |
---|
Specify the TaskExecutor to use for asynchronous work execution
(i.e. startWork(Work)
and scheduleWork(Work)
calls).
This will typically (but not necessarily) be an
AsyncTaskExecutor
implementation.
Default is a SimpleAsyncTaskExecutor
.
Specify the TaskExecutor to use for synchronous work execution
(i.e. doWork(Work)
calls).
Default is a SyncTaskExecutor
.
WorkException |
---|
WorkException |
---|
Execute the given Work on the specified TaskExecutor.
taskExecutor | the TaskExecutor to use |
---|---|
work | the Work to execute |
startTimeout | the time duration within which the Work is supposed to start |
blockUntilStarted | whether to block until the Work has started |
executionContext | the JCA ExecutionContext for the given Work |
workListener | the WorkListener to clal for the given Work |
if the TaskExecutor did not accept the Work | |
WorkException |