spring-framework / org.springframework.jca.work

Package org.springframework.jca.work

Types

DelegatingWork

open class DelegatingWork : Work

Simple Work adapter that delegates to a given Runnable.

SimpleTaskWorkManager

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.

WorkManagerTaskExecutor

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.