Clover coverage report - JFox Service-Oriented Application Framework - 1.0-RC2
Coverage timestamp: 星期四 十二月 15 2005 11:58:01 CST
file stats: LOC: 91   Methods: 4
NCLOC: 31   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
JotmTransactionServiceImpl.java - 50% 50% 50%
coverage coverage
 1   
 /**
 2   
  * @(#)JotmTransactionServiceImpl.java
 3   
  * 
 4   
  * JFoxSOAF, Service-Oriented Application Framework
 5   
  * 
 6   
  * Copyright(c) JFoxSOAF Team
 7   
  * 
 8   
  * Licensed under the GNU LGPL, Version 2.1 (the "License"); 
 9   
  * you may not use this file except in compliance with the License. 
 10   
  * You may obtain a copy of the License at  
 11   
  * 
 12   
  * http://www.gnu.org/copyleft/lesser.html
 13   
  * 
 14   
  * Unless required by applicable law or agreed to in writing, software
 15   
  * distributed under the License is distributed on an "AS IS" BASIS, 
 16   
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 17   
  * See the License for the specific language governing permissions and 
 18   
  * limitations under the License. 
 19   
  * 
 20   
  * For more information, please visit:
 21   
  * http://www.jfox.cn/confluence/display/JFoxSOAF/Home
 22   
  * http://www.huihoo.org/jfox/jfoxsoaf
 23   
  */
 24   
 
 25   
 package org.huihoo.jfox.soaf.services.transaction;
 26   
 
 27   
 import javax.naming.NamingException;
 28   
 import javax.transaction.TransactionManager;
 29   
 import javax.transaction.UserTransaction;
 30   
 
 31   
 import org.apache.commons.logging.Log;
 32   
 import org.apache.commons.logging.LogFactory;
 33   
 import org.objectweb.jotm.Jotm;
 34   
 import org.objectweb.transaction.jta.TMService;
 35   
 import org.picocontainer.Startable;
 36   
 
 37   
 /**
 38   
  * <p>
 39   
  * JOTM transaction service implementation.
 40   
  * </p>
 41   
  * 
 42   
  * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
 43   
  * @version $Revision:$ $Date:$
 44   
  * @version Revision: 1.0
 45   
  */
 46   
 
 47   
 public class JotmTransactionServiceImpl implements JotmTransactionService,
 48   
         Startable {
 49   
     
 50   
     private TMService jotm;
 51   
     
 52   
     private final Log logger = LogFactory.getLog(getClass());
 53   
 
 54   
     /**
 55   
      * @see org.huihoo.jfox.soaf.services.transaction.JotmTransactionService#getTransactionManager()
 56   
      */
 57  0
     public TransactionManager getTransactionManager() {
 58  0
         return jotm.getTransactionManager();
 59   
     }
 60   
 
 61   
     /**
 62   
      * @see org.huihoo.jfox.soaf.services.transaction.JotmTransactionService#getUserTransaction()
 63   
      */
 64  2
     public UserTransaction getUserTransaction() {
 65  2
         return jotm.getUserTransaction();
 66   
     }
 67   
 
 68   
     /**
 69   
      * Start jotm transaction service.
 70   
      * 
 71   
      * @see org.picocontainer.Startable#start()
 72   
      */
 73  10
     public void start() {
 74  10
         try {
 75  10
             jotm = new Jotm(true, false);
 76   
         } catch (NamingException e) {
 77  0
             logger.error("Failed to start JOTM transaction service " + e.getMessage());
 78   
         }
 79  10
         logger.info("Start JOTM transaction service successful.");
 80   
     }
 81   
 
 82   
     /**
 83   
      * Stop jotm transaction service.
 84   
      * 
 85   
      * @see org.picocontainer.Startable#stop()
 86   
      */
 87  0
     public void stop() {
 88  0
         jotm.stop();
 89  0
         logger.info("Stop JOTM transaction service successful.");
 90   
     }
 91   
 }