[jboss-cvs] JBossAS SVN: r76749 - in trunk: connector/src/main/org/jboss/resource/connectionmanager and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 7 03:57:31 EDT 2008


Author: jesper.pedersen
Date: 2008-08-07 03:57:30 -0400 (Thu, 07 Aug 2008)
New Revision: 76749

Added:
   trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapperImpl.java
   trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapper.java
   trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapperImpl.java
Removed:
   trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/JcaXid.java
   trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapper.java
Modified:
   trunk/connector/build.xml
   trunk/connector/src/main/org/jboss/resource/connectionmanager/TxConnectionManager.java
   trunk/thirdparty/pom.xml
Log:
[JBAS-5685] XAResourceWrapper should be in the transaction SPI

Modified: trunk/connector/build.xml
===================================================================
--- trunk/connector/build.xml	2008-08-07 06:43:54 UTC (rev 76748)
+++ trunk/connector/build.xml	2008-08-07 07:57:30 UTC (rev 76749)
@@ -80,6 +80,7 @@
       <path refid="quartz.quartz.classpath"/>
       <path refid="jboss.metadata.classpath"/>       
       <path refid="jboss.jboss.deployers.classpath"/>      
+      <path refid="jboss.integration.classpath"/>
       <path refid="jboss.jboss.cl.classpath"/>
       <path refid="jboss.jboss.man.classpath"/>      
       <path refid="jboss.jboss.mdr.classpath"/>      

Modified: trunk/connector/src/main/org/jboss/resource/connectionmanager/TxConnectionManager.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/TxConnectionManager.java	2008-08-07 06:43:54 UTC (rev 76748)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/TxConnectionManager.java	2008-08-07 07:57:30 UTC (rev 76749)
@@ -48,7 +48,7 @@
 
 import org.jboss.logging.Logger;
 import org.jboss.resource.JBossResourceException;
-import org.jboss.resource.connectionmanager.xa.XAResourceWrapper;
+import org.jboss.resource.connectionmanager.xa.XAResourceWrapperImpl;
 import org.jboss.tm.LastResource;
 import org.jboss.tm.TransactionTimeoutConfiguration;
 import org.jboss.tm.TxUtils;
@@ -438,16 +438,27 @@
          
          if(wrapXAResource)
          {
+            String eisProductName = null;
+            String eisProductVersion = null;
+
+            try
+            {
+               eisProductName = mc.getMetaData().getEISProductName();
+               eisProductVersion = mc.getMetaData().getEISProductVersion();
+            }
+            catch (ResourceException re)
+            {
+               // Ignore
+            }
+
             log.trace("Generating XAResourceWrapper for TxConnectionManager" + this);
-            xaResource = new XAResourceWrapper(isSameRMOverrideValue, padXid, mc.getXAResource());
-            
+            xaResource = new XAResourceWrapperImpl(mc.getXAResource(), padXid, isSameRMOverrideValue, eisProductName, eisProductVersion);
          }
          
          else
          {
             log.trace("Not wrapping XAResource.");
             xaResource = mc.getXAResource();
-            
          }
                                 
          if (xaResourceTimeout != 0)

Deleted: trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/JcaXid.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/JcaXid.java	2008-08-07 06:43:54 UTC (rev 76748)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/JcaXid.java	2008-08-07 07:57:30 UTC (rev 76749)
@@ -1,134 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.resource.connectionmanager.xa;
-
-import java.io.Serializable;
-import java.util.Arrays;
-
-import javax.transaction.xa.Xid;
-
-/**
- * A JcaXid.
- * 
- * @author <a href="weston.price at jboss.com">Weston Price</a>
- * @version $Revision: 1.1 $
- */
-public class JcaXid implements Serializable, Xid
-{
-
-   /** The serialVersionUID */
-   private static final long serialVersionUID = 8226195409384804425L;
-
-   /** The formatId */
-   private int formatId;
-   
-   /** The globalTransactionId */
-   private byte[] globalTransactionId;
-   
-   /** The branchQualifier */
-   private byte[] branchQualifier;
-   
-   /** Cached toString() */
-   private transient String cachedToString;
-
-   /** Cached hashCode() */
-   private transient int cachedHashCode;
-
-   /** Whether or not to pad the id */
-   private boolean pad;
-   
-   public JcaXid(Xid xid)
-   {
-      this(false, xid);
-      
-   }
-   
-   public JcaXid(boolean pad, Xid xid)
-   {
-      this.pad = pad;
-      
-      branchQualifier = (pad) ? new byte[Xid.MAXBQUALSIZE] : new byte[xid.getBranchQualifier().length];      
-      System.arraycopy(xid.getBranchQualifier(), 0, branchQualifier, 0, xid.getBranchQualifier().length);      
-      this.globalTransactionId = xid.getGlobalTransactionId();
-      this.formatId = xid.getFormatId();
-      
-   }
-
-   public byte[] getBranchQualifier()
-   {
-      return this.branchQualifier;
-   }
-
-   public int getFormatId()
-   {
-      return this.formatId;
-   }
-
-   public byte[] getGlobalTransactionId()
-   {
-      return this.globalTransactionId;
-   }
-   
-   public boolean equals(Object object)
-   {
-      if (object == null || (object instanceof Xid) == false)
-         return false;
-
-      Xid other = (Xid) object;
-      return
-      (
-         formatId == other.getFormatId() && 
-         Arrays.equals(globalTransactionId, other.getGlobalTransactionId()) &&
-         Arrays.equals(branchQualifier, other.getBranchQualifier())
-      );
-   }
-
-   public int hashCode()
-   {
-      if (cachedHashCode == 0)
-      {
-         cachedHashCode = formatId;
-         for (int i = 0; i < globalTransactionId.length; ++i)
-            cachedHashCode += globalTransactionId[i];
-      }
-      return cachedHashCode;
-   }
-
-   public String toString()
-   {
-      if (cachedToString == null)
-      {
-         StringBuffer buffer = new StringBuffer();
-         buffer.append("JcaXid[FormatId=").append(getFormatId());
-         buffer.append(" GlobalId=").append(new String(getGlobalTransactionId()).trim());
-         byte[] branchQualifer = getBranchQualifier();
-         buffer.append(" BranchQual=");
-         if (branchQualifer == null)
-            buffer.append("null");
-         else
-            buffer.append(new String(getBranchQualifier()).trim());
-         buffer.append(']');
-         cachedToString = buffer.toString();
-      }
-      return cachedToString;
-   }
-}

Deleted: trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapper.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapper.java	2008-08-07 06:43:54 UTC (rev 76748)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapper.java	2008-08-07 07:57:30 UTC (rev 76749)
@@ -1,178 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.resource.connectionmanager.xa;
-
-import java.io.Serializable;
-
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.jboss.logging.Logger;
-
-/**
- * A XAResourceWrapper.
- * 
- * @author <a href="weston.price at jboss.com">Weston Price</a>
- * @version $Revision: 1.1 $
- */
-public class XAResourceWrapper implements XAResource, Serializable
-{
-
-   /** The serialVersionUID */
-   private static final long serialVersionUID = 4551722165222496828L;
-
-   private static final Logger log = Logger.getLogger(XAResourceWrapper.class);
-   
-   /** The xaResource */
-   private XAResource xaResource;
-
-   private boolean pad;
-
-   private Boolean overrideRmValue;
-   
-   public XAResourceWrapper(XAResource resource)
-   {
-      this(Boolean.FALSE, false, resource);
-
-   }
-
-   public XAResourceWrapper(boolean pad, XAResource resource)
-   {
-      this(Boolean.FALSE, pad, resource);
-   }
-
-   public XAResourceWrapper(Boolean override, boolean pad, XAResource resource)
-   {
-      this.overrideRmValue = override;
-      this.pad = pad;
-      this.xaResource = resource;
-
-   }
-
-   public void commit(Xid xid, boolean onePhase) throws XAException
-   {
-      xid = convertXid(xid);
-      xaResource.commit(xid, onePhase);
-   }
-
-   public void end(Xid xid, int flags) throws XAException
-   {
-      xid = convertXid(xid);
-      xaResource.end(xid, flags);
-
-   }
-
-   public void forget(Xid xid) throws XAException
-   {
-      xid = convertXid(xid);
-      xaResource.forget(xid);
-   }
-
-   public int getTransactionTimeout() throws XAException
-   {
-      return xaResource.getTransactionTimeout();
-   }
-
-   public boolean isSameRM(XAResource resource) throws XAException
-   {
-      
-      if (overrideRmValue != null)
-      {
-         if(log.isTraceEnabled())
-         {
-            log.trace("Executing isSameRM with override value" + overrideRmValue + " for XAResourceWrapper" + this);
-            
-         }
-         
-         return overrideRmValue.booleanValue();
-
-      }
-      else
-      {
-         if(resource instanceof XAResourceWrapper)
-         {
-            XAResourceWrapper other = (XAResourceWrapper)resource;
-            return xaResource.isSameRM(other.getResource());
-            
-         }else
-         {
-            return xaResource.isSameRM(resource);
-            
-         }
-         
-      }
-
-   }
-
-   public int prepare(Xid xid) throws XAException
-   {
-      xid = convertXid(xid);
-      return xaResource.prepare(xid);
-   }
-
-   public Xid[] recover(int flag) throws XAException
-   {
-
-      return xaResource.recover(flag);
-   }
-
-   public void rollback(Xid xid) throws XAException
-   {
-      xid = convertXid(xid);      
-      xaResource.rollback(xid);
-   }
-
-   public boolean setTransactionTimeout(int flag) throws XAException
-   {
-      return xaResource.setTransactionTimeout(flag);
-
-   }
-
-   public void start(Xid xid, int flags) throws XAException
-   {
-      xid = convertXid(xid);
-      xaResource.start(xid, flags);
-   }
-
-   private Xid convertXid(Xid xid)
-   {
-            
-      if (xid instanceof JcaXid)
-         return xid;
-
-      else
-         return new JcaXid(pad, xid);
-
-   }
-
-   private XAResource getResource()
-   {
-      return xaResource;
-   }
-   
-   public String toString()
-   {
-      return super.toString();
-   }
-
-}

Copied: trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapperImpl.java (from rev 75690, trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapper.java)
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapperImpl.java	                        (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapperImpl.java	2008-08-07 07:57:30 UTC (rev 76749)
@@ -0,0 +1,198 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.connectionmanager.xa;
+
+import org.jboss.tm.XAResourceWrapper;
+
+import java.io.Serializable;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A XAResourceWrapper.
+ * 
+ * @author <a href="weston.price at jboss.com">Weston Price</a>
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class XAResourceWrapperImpl implements XAResourceWrapper
+{
+   /** The serialVersionUID */
+   //private static final long serialVersionUID = 4551722165222496828L;
+
+   private static final Logger log = Logger.getLogger(XAResourceWrapperImpl.class);
+   
+   /** The xaResource */
+   private XAResource xaResource;
+
+   private boolean pad;
+
+   private Boolean overrideRmValue;
+
+   private String productName;
+
+   private String productVersion;
+   
+   public XAResourceWrapperImpl(XAResource resource)
+   {
+      this(resource, false, Boolean.FALSE, null, null);
+   }
+
+   public XAResourceWrapperImpl(XAResource resource, boolean pad)
+   {
+      this(resource, pad, Boolean.FALSE, null, null);
+   }
+
+   public XAResourceWrapperImpl(XAResource resource, boolean pad, Boolean override)
+   {
+      this(resource, pad, override, null, null);
+   }
+
+   public XAResourceWrapperImpl(XAResource resource, boolean pad, Boolean override, String productName, String productVersion)
+   {
+      this.overrideRmValue = override;
+      this.pad = pad;
+      this.xaResource = resource;
+      this.productName = productName;
+      this.productVersion = productVersion;
+   }
+
+   public void commit(Xid xid, boolean onePhase) throws XAException
+   {
+      xid = convertXid(xid);
+      xaResource.commit(xid, onePhase);
+   }
+
+   public void end(Xid xid, int flags) throws XAException
+   {
+      xid = convertXid(xid);
+      xaResource.end(xid, flags);
+   }
+
+   public void forget(Xid xid) throws XAException
+   {
+      xid = convertXid(xid);
+      xaResource.forget(xid);
+   }
+
+   public int getTransactionTimeout() throws XAException
+   {
+      return xaResource.getTransactionTimeout();
+   }
+
+   public boolean isSameRM(XAResource resource) throws XAException
+   {
+      if (overrideRmValue != null)
+      {
+         if(log.isTraceEnabled())
+         {
+            log.trace("Executing isSameRM with override value" + overrideRmValue + " for XAResourceWrapper" + this);
+         }
+         return overrideRmValue.booleanValue();
+      }
+      else
+      {
+         if(resource instanceof XAResourceWrapper)
+         {
+            XAResourceWrapper other = (XAResourceWrapper)resource;
+            return xaResource.isSameRM(other.getResource());
+         }
+         else
+         {
+            return xaResource.isSameRM(resource);
+         }
+         
+      }
+   }
+
+   public int prepare(Xid xid) throws XAException
+   {
+      xid = convertXid(xid);
+      return xaResource.prepare(xid);
+   }
+
+   public Xid[] recover(int flag) throws XAException
+   {
+      return xaResource.recover(flag);
+   }
+
+   public void rollback(Xid xid) throws XAException
+   {
+      xid = convertXid(xid);      
+      xaResource.rollback(xid);
+   }
+
+   public boolean setTransactionTimeout(int flag) throws XAException
+   {
+      return xaResource.setTransactionTimeout(flag);
+   }
+
+   public void start(Xid xid, int flags) throws XAException
+   {
+      xid = convertXid(xid);
+      xaResource.start(xid, flags);
+   }
+
+   /**
+    * Get the XAResource that is being wrapped
+    * @return The XAResource
+    */
+   public XAResource getResource()
+   {
+      return xaResource;
+   }
+
+   /**
+    * Get product name
+    * @return Product name of the instance if defined; otherwise <code>null</code>
+    */
+   public String getProductName()
+   {
+      return productName;
+   }
+
+   /**
+    * Get product version
+    * @return Product version of the instance if defined; otherwise <code>null</code>
+    */
+   public String getProductVersion()
+   {
+      return productVersion;
+   }
+
+   private Xid convertXid(Xid xid)
+   {
+      if (xid instanceof XidWrapper)
+         return xid;
+      else
+         return new XidWrapperImpl(pad, xid);
+   }
+
+   public String toString()
+   {
+      return super.toString();
+   }
+}


Property changes on: trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapperImpl.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Added: trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapper.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapper.java	                        (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapper.java	2008-08-07 07:57:30 UTC (rev 76749)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.connectionmanager.xa;
+
+import java.io.Serializable;
+
+import javax.transaction.xa.Xid;
+
+/**
+ * A XidWrapper.
+ * 
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public interface XidWrapper extends Serializable, Xid
+{
+}

Copied: trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapperImpl.java (from rev 75690, trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/JcaXid.java)
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapperImpl.java	                        (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapperImpl.java	2008-08-07 07:57:30 UTC (rev 76749)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.connectionmanager.xa;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+import javax.transaction.xa.Xid;
+
+/**
+ * A XidWrapper.
+ * 
+ * @author <a href="weston.price at jboss.com">Weston Price</a>
+ * @version $Revision: 1.1 $
+ */
+public class XidWrapperImpl implements XidWrapper
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 8226195409384804425L;
+
+   /** The formatId */
+   private int formatId;
+   
+   /** The globalTransactionId */
+   private byte[] globalTransactionId;
+   
+   /** The branchQualifier */
+   private byte[] branchQualifier;
+   
+   /** Cached toString() */
+   private transient String cachedToString;
+
+   /** Cached hashCode() */
+   private transient int cachedHashCode;
+
+   /** Whether or not to pad the id */
+   private boolean pad;
+   
+   public XidWrapperImpl(Xid xid)
+   {
+      this(false, xid);
+   }
+   
+   public XidWrapperImpl(boolean pad, Xid xid)
+   {
+      this.pad = pad;
+      
+      branchQualifier = (pad) ? new byte[Xid.MAXBQUALSIZE] : new byte[xid.getBranchQualifier().length];      
+      System.arraycopy(xid.getBranchQualifier(), 0, branchQualifier, 0, xid.getBranchQualifier().length);      
+      this.globalTransactionId = xid.getGlobalTransactionId();
+      this.formatId = xid.getFormatId();
+   }
+
+   public byte[] getBranchQualifier()
+   {
+      return this.branchQualifier;
+   }
+
+   public int getFormatId()
+   {
+      return this.formatId;
+   }
+
+   public byte[] getGlobalTransactionId()
+   {
+      return this.globalTransactionId;
+   }
+   
+   public boolean equals(Object object)
+   {
+      if (object == null || (object instanceof Xid) == false)
+         return false;
+
+      Xid other = (Xid) object;
+      return
+      (
+         formatId == other.getFormatId() && 
+         Arrays.equals(globalTransactionId, other.getGlobalTransactionId()) &&
+         Arrays.equals(branchQualifier, other.getBranchQualifier())
+      );
+   }
+
+   public int hashCode()
+   {
+      if (cachedHashCode == 0)
+      {
+         cachedHashCode = formatId;
+         for (int i = 0; i < globalTransactionId.length; ++i)
+            cachedHashCode += globalTransactionId[i];
+      }
+      return cachedHashCode;
+   }
+
+   public String toString()
+   {
+      if (cachedToString == null)
+      {
+         StringBuffer buffer = new StringBuffer();
+         buffer.append("XidWrapper[FormatId=").append(getFormatId());
+         buffer.append(" GlobalId=").append(new String(getGlobalTransactionId()).trim());
+         byte[] branchQualifer = getBranchQualifier();
+         buffer.append(" BranchQual=");
+         if (branchQualifer == null)
+            buffer.append("null");
+         else
+            buffer.append(new String(getBranchQualifier()).trim());
+         buffer.append(']');
+         cachedToString = buffer.toString();
+      }
+      return cachedToString;
+   }
+}


Property changes on: trunk/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapperImpl.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/thirdparty/pom.xml
===================================================================
--- trunk/thirdparty/pom.xml	2008-08-07 06:43:54 UTC (rev 76748)
+++ trunk/thirdparty/pom.xml	2008-08-07 07:57:30 UTC (rev 76749)
@@ -1282,6 +1282,10 @@
     </dependency>
     <dependency>
       <groupId>org.jboss.integration</groupId>
+      <artifactId>jboss-deployment-spi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.integration</groupId>
       <artifactId>jboss-transaction-spi</artifactId>
     </dependency>
     <dependency>




More information about the jboss-cvs-commits mailing list