org.exolab.jms.tranlog
Class ExternalXid

java.lang.Object
  extended by org.exolab.jms.tranlog.ExternalXid
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, javax.transaction.xa.Xid

public final class ExternalXid
extends java.lang.Object
implements javax.transaction.xa.Xid, java.io.Externalizable

This class maps an external XID that is set in the transaction manager. It needs to do this so that it can use it internally.

Version:
$Revision: 1.1 $ $Date: 2004/11/26 01:51:01 $
Author:
Jim Alateras
See Also:
Xid, Serialized Form

Field Summary
protected static char[] HEX_DIGITS
          Efficient mapping from 4 bit value to lower case hexadecimal digit.
 
Fields inherited from interface javax.transaction.xa.Xid
MAXBQUALSIZE, MAXGTRIDSIZE
 
Constructor Summary
ExternalXid()
          Default constructor for Serialization
ExternalXid(int formatId, byte[] global, byte[] branch)
          Create an insrance of this class using the specified format id, global transaction id and the branch qualifier.
ExternalXid(javax.transaction.xa.Xid xid)
          Create an instance of this class using the specified XID.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 byte[] getBranchQualifier()
           
 int getFormatId()
           
 byte[] getGlobalTransactionId()
           
 int hashCode()
           
 void readExternal(java.io.ObjectInput stream)
           
 java.lang.String toString()
          Returns the global transaction identifier in the form of exid://formatId.global.branch
 void writeExternal(java.io.ObjectOutput stream)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HEX_DIGITS

protected static final char[] HEX_DIGITS
Efficient mapping from 4 bit value to lower case hexadecimal digit. gobbled from Tyrex imple

Constructor Detail

ExternalXid

public ExternalXid()
Default constructor for Serialization


ExternalXid

public ExternalXid(javax.transaction.xa.Xid xid)
Create an instance of this class using the specified XID. This will always create a new instance and copy the format id, global transaction id and branch qualifier id to the new instance

Parameters:
xid - - the xid to use

ExternalXid

public ExternalXid(int formatId,
                   byte[] global,
                   byte[] branch)
Create an insrance of this class using the specified format id, global transaction id and the branch qualifier.

Parameters:
formatId - - the format identifier
global - - the global transaction identifier
branch - - the branch qualifier
Method Detail

getFormatId

public int getFormatId()
Specified by:
getFormatId in interface javax.transaction.xa.Xid

getGlobalTransactionId

public byte[] getGlobalTransactionId()
Specified by:
getGlobalTransactionId in interface javax.transaction.xa.Xid

getBranchQualifier

public byte[] getBranchQualifier()
Specified by:
getBranchQualifier in interface javax.transaction.xa.Xid

toString

public java.lang.String toString()
Returns the global transaction identifier in the form of exid://formatId.global.branch

Overrides:
toString in class java.lang.Object
Returns:
String

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

writeExternal

public void writeExternal(java.io.ObjectOutput stream)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput stream)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException


Copyright © 1999-2012 The OpenJMS Group. All Rights Reserved.