[jboss-svn-commits] JBL Code SVN: r28458 - labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/persistence/xa.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Jul 26 15:18:25 EDT 2009


Author: whitingjr
Date: 2009-07-26 15:18:24 -0400 (Sun, 26 Jul 2009)
New Revision: 28458

Removed:
   labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/persistence/xa/XAResourceManager.java
Log:
Removed.

Deleted: labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/persistence/xa/XAResourceManager.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/persistence/xa/XAResourceManager.java	2009-07-26 19:17:55 UTC (rev 28457)
+++ labs/jbosstm/workspace/whitingjr/trunk/MVCCSampleSTM/src/main/java/uk/ac/ncl/sdia/a8905943/persistence/xa/XAResourceManager.java	2009-07-26 19:18:24 UTC (rev 28458)
@@ -1,88 +0,0 @@
-/*
- * JBoss, the OpenSource J2EE webOS
- * 
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package uk.ac.ncl.sdia.a8905943.persistence.xa;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.apache.log4j.Logger;
-
-/**
- * The purpose of this object is to handle the work carried out XAResources 
- * and any of the enlisted work.
- * 
- * @author <a href="whitingjr at hotmail.com">Jeremy Whiting</a>
- * @version $Revision: 1.1 $
- */
-public class XAResourceManager
-{
-   private final Map<Xid, BranchMapping> xIdmappings = new HashMap<Xid, BranchMapping> ();
-   private static final Logger logger = Logger.getLogger(XAResourceManager.class);
-   
-   /**
-    * Access to this manager instance needs to be synchronized.
-    * 
-    * @param connection
-    * @param resource
-    * @param xId
-    * @param xFlag
-    * @throws XAException
-    */
-   public synchronized void start(STMXAConnectionImpl connection, STMXAResource resource, Xid xId, int xFlag) throws XAException
-   {
-      if (logger.isTraceEnabled())
-      {
-         logger.trace("ResourceManager.start called with xid["+xId+"] and flag["+xFlag+"].");
-      }
-      BranchMapping mapping = this.xIdmappings.get(xId);
-      switch (xFlag)
-      {
-         case XAResource.TMRESUME:
-            if (null == mapping)
-            {
-               logger.error("An attempt to resume a branch that is not associated with the XAResourceManager.");
-               throw new XAException(XAException.XA_RBPROTO);
-            }
-            else if (ResourceStatus.SUSPENDED ==  mapping.getStatus())
-            {
-               logger.debug("Resuming transaction branch.");
-               mapping.changeStatus(ResourceStatus.ACTIVE);  
-            }
-            else
-            {
-               logger.error("Attemt to resume a branch that was not suspended.");
-               throw new XAException(XAException.XA_RBPROTO);
-            }
-            break;
-         case XAResource.TMNOFLAGS:
-            /* this is a request to associate a transaction branch with resource manager.
-             *  check for existing association and create one if not found  */ 
-            if (null == mapping)
-            {// create the association
-               mapping  = new BranchMapping(xId, connection, ResourceStatus.ACTIVE);
-               this.xIdmappings.put(xId, mapping);
-            }
-            else
-            {
-               
-            }
-            
-            break;
-         default :
-            logger.error("Unexpected xFlag received for XAResource.start");
-            break;
-      }
-      
-      
-      
-   }
-   
-}



More information about the jboss-svn-commits mailing list