1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.core.ojb;
17
18 import javax.transaction.TransactionManager;
19
20 import org.apache.log4j.Logger;
21 import org.springframework.beans.factory.BeanFactory;
22 import org.springframework.beans.factory.DisposableBean;
23 import org.springframework.beans.factory.InitializingBean;
24 import org.springmodules.orm.ojb.support.LocalOjbConfigurer;
25
26
27
28
29
30
31
32 public class JtaOjbConfigurer extends LocalOjbConfigurer implements InitializingBean, DisposableBean {
33 private static final Logger LOG = Logger.getLogger(JtaOjbConfigurer.class);
34
35 private TransactionManager transactionManager;
36
37 @Override
38 public void setBeanFactory(BeanFactory beanFactory) {
39 super.setBeanFactory(beanFactory);
40 RiceDataSourceConnectionFactory.addBeanFactory(beanFactory);
41 }
42
43 public void afterPropertiesSet() {
44 LOG.debug("Setting OJB WorkflowTransactionManagerFactory transaction manager to: " + this.transactionManager);
45 TransactionManagerFactory.setTransactionManager(this.transactionManager);
46 }
47
48 public void destroy() {
49 this.transactionManager = null;
50 }
51
52 public void setTransactionManager(TransactionManager transactionManager) {
53 this.transactionManager = transactionManager;
54 }
55 }