Coverage Report - org.mule.util.xa.AbstractXAResourceManager
 
Classes in this File Line Coverage Branch Coverage Complexity
AbstractXAResourceManager
0%
0/19
0%
0/2
1.222
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.util.xa;
 8  
 
 9  
 import java.util.HashMap;
 10  
 import java.util.Map;
 11  
 
 12  
 import javax.transaction.xa.Xid;
 13  
 
 14  
 public abstract class AbstractXAResourceManager extends AbstractResourceManager
 15  
 {
 16  
 
 17  0
     protected Map suspendedContexts = new HashMap();
 18  0
     protected Map activeContexts = new HashMap();
 19  
 
 20  
     public AbstractXAResourceManager()
 21  
     {
 22  0
         super();
 23  0
     }
 24  
 
 25  
     protected boolean includeBranchInXid()
 26  
     {
 27  0
         return true;
 28  
     }
 29  
 
 30  
     AbstractTransactionContext getTransactionalResource(Xid xid)
 31  
     {
 32  0
         AbstractTransactionContext context = getActiveTransactionalResource(xid);
 33  0
         if (context != null)
 34  
         {
 35  0
             return context;
 36  
         }
 37  
         else
 38  
         {
 39  0
             return getSuspendedTransactionalResource(xid);
 40  
         }
 41  
     }
 42  
 
 43  
     AbstractTransactionContext getActiveTransactionalResource(Xid xid)
 44  
     {
 45  0
         return (AbstractTransactionContext) activeContexts.get(xid);
 46  
     }
 47  
 
 48  
     AbstractTransactionContext getSuspendedTransactionalResource(Xid xid)
 49  
     {
 50  0
         return (AbstractTransactionContext) suspendedContexts.get(xid);
 51  
     }
 52  
 
 53  
     void addActiveTransactionalResource(Xid xid, AbstractTransactionContext context)
 54  
     {
 55  0
         activeContexts.put(xid, context);
 56  0
     }
 57  
 
 58  
     void addSuspendedTransactionalResource(Xid xid, AbstractTransactionContext context)
 59  
     {
 60  0
         suspendedContexts.put(xid, context);
 61  0
     }
 62  
 
 63  
     void removeActiveTransactionalResource(Xid xid)
 64  
     {
 65  0
         activeContexts.remove(xid);
 66  0
     }
 67  
 
 68  
     void removeSuspendedTransactionalResource(Xid xid)
 69  
     {
 70  0
         suspendedContexts.remove(xid);
 71  0
     }
 72  
 
 73  
 }