Coverage Report - org.mule.providers.jms.xa.XAResourceWrapper
 
Classes in this File Line Coverage Branch Coverage Complexity
XAResourceWrapper
70%
16/23
50%
1/2
1.083
 
 1  
 /*
 2  
  * $Id: XAResourceWrapper.java 10469 2008-01-22 21:21:05Z aperepel $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 package org.mule.providers.jms.xa;
 11  
 
 12  
 import javax.transaction.xa.XAException;
 13  
 import javax.transaction.xa.XAResource;
 14  
 import javax.transaction.xa.Xid;
 15  
 
 16  
 /**
 17  
  * Arjuna can't serialize proxy
 18  
  */
 19  
 public class XAResourceWrapper implements XAResource
 20  
 {
 21  
 
 22  
     private XAResource xaResource;
 23  
     private SessionInvocationHandler sessionInvocationHandler;
 24  
 
 25  
     public XAResourceWrapper(XAResource xaResource, SessionInvocationHandler sessionInvocationHandler)
 26  24
     {
 27  24
         this.xaResource = xaResource;
 28  24
         this.sessionInvocationHandler = sessionInvocationHandler;
 29  24
     }
 30  
 
 31  
     public int getTransactionTimeout() throws XAException
 32  
     {
 33  0
         return xaResource.getTransactionTimeout();
 34  
     }
 35  
 
 36  
     public boolean setTransactionTimeout(int i) throws XAException
 37  
     {
 38  27
         return xaResource.setTransactionTimeout(i);
 39  
     }
 40  
 
 41  
     public boolean isSameRM(XAResource xaResource) throws XAException
 42  
     {
 43  4
         if (xaResource instanceof XAResourceWrapper)
 44  
         {
 45  0
             xaResource = ((XAResourceWrapper) xaResource).xaResource;
 46  
         }
 47  4
         return this.xaResource.isSameRM(xaResource);
 48  
     }
 49  
 
 50  
     public Xid[] recover(int i) throws XAException
 51  
     {
 52  0
         return xaResource.recover(i);
 53  
     }
 54  
 
 55  
     public int prepare(Xid xid) throws XAException
 56  
     {
 57  0
         return xaResource.prepare(xid);
 58  
     }
 59  
 
 60  
     public void forget(Xid xid) throws XAException
 61  
     {
 62  0
         xaResource.forget(xid);
 63  0
     }
 64  
 
 65  
     public void rollback(Xid xid) throws XAException
 66  
     {
 67  15
         xaResource.rollback(xid);
 68  5
     }
 69  
 
 70  
     public void end(Xid xid, int i) throws XAException
 71  
     {
 72  37
         xaResource.end(xid, i);
 73  31
         sessionInvocationHandler.setEnlisted(false);
 74  31
     }
 75  
 
 76  
     public void start(Xid xid, int i) throws XAException
 77  
     {
 78  27
         xaResource.start(xid, i);
 79  28
     }
 80  
 
 81  
     public void commit(Xid xid, boolean b) throws XAException
 82  
     {
 83  16
         xaResource.commit(xid, b);
 84  16
     }
 85  
 
 86  
     public String toString()
 87  
     {
 88  0
         return xaResource.toString();
 89  
     }
 90  
 }