open class WorkManagerTaskExecutor : JndiLocatorSupport, AsyncListenableTaskExecutor, SchedulingTaskExecutor, WorkManager, InitializingBean
TaskExecutor implementation that delegates to a CommonJ WorkManager, implementing the commonj.work.WorkManager interface, which either needs to be specified as reference or through the JNDI name.
This is the central convenience class for setting up a CommonJ WorkManager in a Spring context.
Also implements the CommonJ 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 CommonJ WorkManager interface.
The CommonJ WorkManager will usually be retrieved from the application server's JNDI environment, as defined in the server's management console.
Note: On the upcoming EE 7 compliant versions of WebLogic and WebSphere, a org.springframework.scheduling.concurrent.DefaultManagedTaskExecutor should be preferred, following JSR-236 support in Java EE 7.
Author
Juergen Hoeller
Since
2.0
WorkManagerTaskExecutor()
TaskExecutor implementation that delegates to a CommonJ WorkManager, implementing the commonj.work.WorkManager interface, which either needs to be specified as reference or through the JNDI name. This is the central convenience class for setting up a CommonJ WorkManager in a Spring context. Also implements the CommonJ 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 CommonJ WorkManager interface. The CommonJ WorkManager will usually be retrieved from the application server's JNDI environment, as defined in the server's management console. Note: On the upcoming EE 7 compliant versions of WebLogic and WebSphere, a org.springframework.scheduling.concurrent.DefaultManagedTaskExecutor should be preferred, following JSR-236 support in Java EE 7. |
open fun afterPropertiesSet(): Unit |
|
open fun execute(task: Runnable): Unitopen fun execute(task: Runnable, startTimeout: Long): Unit |
|
open fun prefersShortLivedTasks(): Boolean
This task executor prefers short-lived work units. |
|
open fun schedule(work: Work): WorkItemopen fun schedule(work: Work, workListener: WorkListener): WorkItem |
|
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 CommonJ 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 CommonJ WorkManager to delegate to. Alternatively, you can also specify the JNDI name of the target WorkManager. |
|
open fun setWorkManagerName(workManagerName: String): Unit
Set the JNDI name of the CommonJ 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 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> |
|
open fun waitForAll(workItems: MutableCollection<Any?>, timeout: Long): Boolean |
|
open fun waitForAny(workItems: MutableCollection<Any?>, timeout: Long): MutableCollection<Any?> |