Coverage Report - org.kuali.rice.core.framework.persistence.ojb.JtaOjbConfigurer
 
Classes in this File Line Coverage Branch Coverage Complexity
JtaOjbConfigurer
0%
0/12
N/A
1
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 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  
  * Utility bean that sets the JTA TransactionManager on the WorkflowTransactionManagerFactory, the
 28  
  * OJB TransactionManagerFactory implementation that makes this available from Workflow core.
 29  
  * @see TransactionManagerFactory
 30  
  * @see org.apache.ojb.broker.transaction.tm.TransactionManagerFactory
 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  
 }