open class SimpleTaskWorkManager : WorkManager
Simple JCA 1.7 javax.resource.spi.work.WorkManager implementation that delegates to a Spring org.springframework.core.task.TaskExecutor. Provides simple task execution including start timeouts, but without support for a JCA ExecutionContext (i.e. without support for imported transactions).
Uses a org.springframework.core.task.SyncTaskExecutor for #doWork
calls and a org.springframework.core.task.SimpleAsyncTaskExecutor for #startWork
and #scheduleWork
calls, by default. These default task executors can be overridden through configuration.
NOTE: This WorkManager does not provide thread pooling by default! Specify a org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor (or any other thread-pooling TaskExecutor) as "asyncTaskExecutor" in order to achieve actual thread pooling.
This WorkManager automatically detects a specified org.springframework.core.task.AsyncTaskExecutor implementation and uses its extended timeout functionality where appropriate. JCA WorkListeners are fully supported in any case.
Author
Juergen Hoeller
Since
2.0.3
See Also
#setSyncTaskExecutor#setAsyncTaskExecutor
SimpleTaskWorkManager()
Simple JCA 1.7 javax.resource.spi.work.WorkManager implementation that delegates to a Spring org.springframework.core.task.TaskExecutor. Provides simple task execution including start timeouts, but without support for a JCA ExecutionContext (i.e. without support for imported transactions). Uses a org.springframework.core.task.SyncTaskExecutor for NOTE: This WorkManager does not provide thread pooling by default! Specify a org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor (or any other thread-pooling TaskExecutor) as "asyncTaskExecutor" in order to achieve actual thread pooling. This WorkManager automatically detects a specified org.springframework.core.task.AsyncTaskExecutor implementation and uses its extended timeout functionality where appropriate. JCA WorkListeners are fully supported in any case. |
open fun doWork(work: Work): Unit open fun doWork(work: Work, startTimeout: Long, executionContext: ExecutionContext, workListener: WorkListener): Unit |
|
open fun scheduleWork(work: Work): Unit open fun scheduleWork(work: Work, startTimeout: Long, executionContext: ExecutionContext, workListener: WorkListener): Unit |
|
open fun setAsyncTaskExecutor(asyncTaskExecutor: AsyncTaskExecutor): Unit
Specify the TaskExecutor to use for asynchronous work execution (i.e. This will typically (but not necessarily) be an org.springframework.core.task.AsyncTaskExecutor implementation. Default is a org.springframework.core.task.SimpleAsyncTaskExecutor. |
|
open fun setSyncTaskExecutor(syncTaskExecutor: TaskExecutor): Unit
Specify the TaskExecutor to use for synchronous work execution (i.e. Default is a org.springframework.core.task.SyncTaskExecutor. |
|
open fun startWork(work: Work): Long open fun startWork(work: Work, startTimeout: Long, executionContext: ExecutionContext, workListener: WorkListener): Long |