[jboss-cvs] JBossAS SVN: r59871 - branches/Branch_4_2/connector/src/main/org/jboss/resource/connectionmanager/xa.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Jan 20 01:59:05 EST 2007
Author: weston.price at jboss.com
Date: 2007-01-20 01:59:05 -0500 (Sat, 20 Jan 2007)
New Revision: 59871
Removed:
branches/Branch_4_2/connector/src/main/org/jboss/resource/connectionmanager/xa/JcaXid.java
Log:
[JBAS-3183] XAResourceWrapper for foreign provider JMS integration.
Deleted: branches/Branch_4_2/connector/src/main/org/jboss/resource/connectionmanager/xa/JcaXid.java
===================================================================
--- branches/Branch_4_2/connector/src/main/org/jboss/resource/connectionmanager/xa/JcaXid.java 2007-01-20 06:57:33 UTC (rev 59870)
+++ branches/Branch_4_2/connector/src/main/org/jboss/resource/connectionmanager/xa/JcaXid.java 2007-01-20 06:59:05 UTC (rev 59871)
@@ -1,144 +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;
-
-/**
- * @author <a href="mailto:weston.price at jboss.com>Weston Price</a>
- * @version $Revision: 45310 $
- */
-public class JcaXid implements Serializable, Xid
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = 5805807959548006486L;
-
- /** The format id */
- private final int formatId;
-
- /** The gid */
- private final byte[] globalTransactionId;
-
- /** The branch */
- private final byte[] branchQualifier;
-
- /** Cached toString() */
- private transient String cachedToString;
-
- /** Cached hashCode() */
- private transient int cachedHashCode;
-
- public JcaXid(final Xid xid, final boolean pad)
- {
- //Copy global id, pad where necessary
- if(pad)
- {
- globalTransactionId = new byte[Xid.MAXGTRIDSIZE];
- System.arraycopy(xid.getGlobalTransactionId(), 0, this.globalTransactionId, 0, xid.getGlobalTransactionId().length);
- branchQualifier = new byte[Xid.MAXBQUALSIZE];
- System.arraycopy(xid.getBranchQualifier(), 0, this.branchQualifier, 0, xid.getBranchQualifier().length);
-
- }
- else
- {
- globalTransactionId = xid.getGlobalTransactionId();
- this.branchQualifier = xid.getBranchQualifier();
-
- }
-
- this.formatId = xid.getFormatId();
-
- }
- /**
- * Create a new wrapper Xid
- *
- * @param xid the wrapped xid
- */
- public JcaXid(final Xid xid)
- {
- this(xid, false);
- }
-
- public int getFormatId()
- {
- return formatId;
- }
-
- public byte[] getGlobalTransactionId()
- {
- return globalTransactionId;
- }
-
- public byte[] getBranchQualifier()
- {
- return branchQualifier;
- }
-
- public boolean equals(Object object)
- {
-
- if(!(object instanceof JcaXid))
- 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;
- }
-}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list