Print
Work Manager

The J2EE/JCA specification provides a WorkManager interface which provides a J2EE compliant way of working with a thread pool, scheduling work and creating timerse. In enterprise environments & containers you often wish to setup the thread for security or transaction contexts; so WorkManager works well with application server components.

The following example shows how to setup a WorkManager in Jencks inside your spring.xml

<bean name="transactionManager" class="org.jencks.factory.TransactionManagerFactoryBean"/>

<bean id="workManager" class="org.jencks.factory.WorkManagerFactoryBean" destroy-method="stop">
  <property name="threadPoolSize" value="25"/>
  <property name="transactionManager" ref="transactionManager"/>
</bean>

This will also associate a default transaction manager (with no XA recovery by default). Notice you can configure the thread pool size.

Powered by Atlassian Confluence