org.apache.commons.transaction.util.xa
Class XidWrapper

java.lang.Object
  extended by org.apache.commons.transaction.util.xa.XidWrapper
All Implemented Interfaces:
Xid

public class XidWrapper
extends Object
implements Xid

Wraps an Xid to guarantee methods for equality and hashcode are implemented correctly. This is escpecially necessary when the Xid is used as a key in a HashMap.

Version:
$Revision$

Field Summary
 
Fields inherited from interface javax.transaction.xa.Xid
MAXBQUALSIZE, MAXGTRIDSIZE
 
Method Summary
 boolean equals(Object o)
           
 byte[] getBranchQualifier()
           
 int getFormatId()
           
 byte[] getGlobalTransactionId()
           
 Xid getXid()
           
 int hashCode()
           
 String toString()
           
static Xid wrap(Xid xid)
           
static Xid wrap(Xid xid, boolean includeBranch)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

wrap

public static final Xid wrap(Xid xid)

wrap

public static final Xid wrap(Xid xid,
                             boolean includeBranch)

getXid

public Xid getXid()

getFormatId

public int getFormatId()
Specified by:
getFormatId in interface Xid

getGlobalTransactionId

public byte[] getGlobalTransactionId()
Specified by:
getGlobalTransactionId in interface Xid

getBranchQualifier

public byte[] getBranchQualifier()
Specified by:
getBranchQualifier in interface Xid

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2004 The Apache Software Foundation. All Rights Reserved.