001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.core.framework.persistence.ojb; 017 018import javax.transaction.TransactionManager; 019 020import org.apache.log4j.Logger; 021import org.springframework.beans.factory.BeanFactory; 022import org.springframework.beans.factory.DisposableBean; 023import org.springframework.beans.factory.InitializingBean; 024import org.springmodules.orm.ojb.support.LocalOjbConfigurer; 025 026/** 027 * Utility bean that sets the JTA TransactionManager on the WorkflowTransactionManagerFactory, the 028 * OJB TransactionManagerFactory implementation that makes this available from Workflow core. 029 * @see TransactionManagerFactory 030 * @see org.apache.ojb.broker.transaction.tm.TransactionManagerFactory 031 */ 032@Deprecated 033public class JtaOjbConfigurer extends LocalOjbConfigurer implements InitializingBean, DisposableBean { 034 private static final Logger LOG = Logger.getLogger(JtaOjbConfigurer.class); 035 036 private TransactionManager transactionManager; 037 038 @Override 039 public void setBeanFactory(BeanFactory beanFactory) { 040 super.setBeanFactory(beanFactory); 041 RiceDataSourceConnectionFactory.addBeanFactory(beanFactory); 042 } 043 044 public void afterPropertiesSet() { 045 LOG.debug("Setting OJB WorkflowTransactionManagerFactory transaction manager to: " + this.transactionManager); 046 TransactionManagerFactory.setTransactionManager(this.transactionManager); 047 } 048 049 public void destroy() { 050 this.transactionManager = null; 051 } 052 053 public void setTransactionManager(TransactionManager transactionManager) { 054 this.transactionManager = transactionManager; 055 } 056}