| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.core.framework.persistence.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 | 0 | public class JtaOjbConfigurer extends LocalOjbConfigurer implements InitializingBean, DisposableBean { |
| 33 | 0 | private static final Logger LOG = Logger.getLogger(JtaOjbConfigurer.class); |
| 34 | |
|
| 35 | |
private TransactionManager transactionManager; |
| 36 | |
|
| 37 | |
@Override |
| 38 | |
public void setBeanFactory(BeanFactory beanFactory) { |
| 39 | 0 | super.setBeanFactory(beanFactory); |
| 40 | 0 | RiceDataSourceConnectionFactory.addBeanFactory(beanFactory); |
| 41 | 0 | } |
| 42 | |
|
| 43 | |
public void afterPropertiesSet() { |
| 44 | 0 | LOG.debug("Setting OJB WorkflowTransactionManagerFactory transaction manager to: " + this.transactionManager); |
| 45 | 0 | TransactionManagerFactory.setTransactionManager(this.transactionManager); |
| 46 | 0 | } |
| 47 | |
|
| 48 | |
public void destroy() { |
| 49 | 0 | this.transactionManager = null; |
| 50 | 0 | } |
| 51 | |
|
| 52 | |
public void setTransactionManager(TransactionManager transactionManager) { |
| 53 | 0 | this.transactionManager = transactionManager; |
| 54 | 0 | } |
| 55 | |
} |