open class WorkManagerTaskExecutor : JndiLocatorSupport, AsyncListenableTaskExecutor, SchedulingTaskExecutor, WorkManager, BootstrapContextAware, InitializingBean
org.springframework.core.task.TaskExecutor implementation that delegates to a JCA 1.7 WorkManager, implementing the javax.resource.spi.work.WorkManager interface.
This is mainly intended for use within a JCA ResourceAdapter implementation, but may also be used in a standalone environment, delegating to a locally embedded WorkManager implementation (such as Geronimo's).
Also implements the JCA 1.7 WorkManager interface itself, delegating all calls to the target WorkManager. Hence, a caller can choose whether it wants to talk to this executor through the Spring TaskExecutor interface or the WorkManager interface.
This adapter is also capable of obtaining a JCA WorkManager from JNDI. This is for example appropriate on the Geronimo application server, where WorkManager GBeans (e.g. Geronimo's default "DefaultWorkManager" GBean) can be linked into the Java EE environment through "gbean-ref" entries in the geronimo-web.xml
deployment descriptor.
Author
Juergen Hoeller
Since
2.0.3
See Also
#setWorkManagerjavax.resource.spi.work.WorkManager#scheduleWork
WorkManagerTaskExecutor()
Create a new WorkManagerTaskExecutor, expecting bean-style configuration. WorkManagerTaskExecutor(workManager: WorkManager)
Create a new WorkManagerTaskExecutor for the given WorkManager. |
open fun afterPropertiesSet(): Unit |
|
open fun doWork(work: Work): Unit open fun doWork(work: Work, delay: Long, executionContext: ExecutionContext, workListener: WorkListener): Unit |
|
open fun execute(task: Runnable): Unit open fun execute(task: Runnable, startTimeout: Long): Unit |
|
open fun prefersShortLivedTasks(): Boolean
This task executor prefers short-lived work units. |
|
open fun scheduleWork(work: Work): Unit open fun scheduleWork(work: Work, delay: Long, executionContext: ExecutionContext, workListener: WorkListener): Unit |
|
open fun setBlockUntilCompleted(blockUntilCompleted: Boolean): Unit
Set whether to let Uses the JCA |
|
open fun setBlockUntilStarted(blockUntilStarted: Boolean): Unit
Set whether to let Uses the JCA |
|
open fun setBootstrapContext(bootstrapContext: BootstrapContext): Unit
Specify the JCA BootstrapContext that contains the WorkManager to delegate to. |
|
open fun setTaskDecorator(taskDecorator: TaskDecorator): Unit
Specify a custom TaskDecorator to be applied to any Runnable about to be executed. Note that such a decorator is not necessarily being applied to the user-supplied The primary use case is to set some execution context around the task's invocation, or to provide some monitoring/statistics for task execution. |
|
open fun setWorkListener(workListener: WorkListener): Unit
Specify a JCA WorkListener to apply, if any. This shared WorkListener instance will be passed on to the WorkManager by all |
|
open fun setWorkManager(workManager: WorkManager): Unit
Specify the JCA WorkManager instance to delegate to. |
|
open fun setWorkManagerName(workManagerName: String): Unit
Set the JNDI name of the JCA WorkManager. This can either be a fully qualified JNDI name, or the JNDI name relative to the current environment naming context if "resourceRef" is set to "true". |
|
open fun startWork(work: Work): Long open fun startWork(work: Work, delay: Long, executionContext: ExecutionContext, workListener: WorkListener): Long |
|
open fun submit(task: Runnable): Future<*> open fun <T : Any> submit(task: Callable<T>): Future<T> |
|
open fun submitListenable(task: Runnable): ListenableFuture<*> open fun <T : Any> submitListenable(task: Callable<T>): ListenableFuture<T> |