com.atomikos.datasource.xa
Class XID

java.lang.Object
  extended by com.atomikos.datasource.xa.XID
All Implemented Interfaces:
Serializable, Xid

public class XID
extends Object
implements Serializable, Xid

An adaptor class for mapping a String to Xid type.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.transaction.xa.Xid
MAXBQUALSIZE, MAXGTRIDSIZE
 
Constructor Summary
XID(String tid, String resourceURL)
          Create a new instance with the resource name as branch.
XID(Xid xid)
          Copy constructor needed during recovery: if the data source returns inappropriate instances (that do not implement equals and hashCode) then we will need this constructor.
 
Method Summary
 boolean equals(Object obj)
           
 byte[] getBranchQualifier()
           
 int getFormatId()
           
 byte[] getGlobalTransactionId()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XID

public XID(String tid,
           String resourceURL)
Create a new instance with the resource name as branch. This is the main constructor for new instances.

Parameters:
tid - The global transaction identifier.
resourceURL - The name of the resource in the current configuration (UNIQUE!), needed for recovering the XIDs for this configuration. The resulting branch qualifier will ALWAYS start with the name of the resource, and this can be used during recovery to identify the XIDs to be recovered.

XID

public XID(Xid xid)
Copy constructor needed during recovery: if the data source returns inappropriate instances (that do not implement equals and hashCode) then we will need this constructor.

Parameters:
xid - The xid.
Method Detail

getFormatId

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

getBranchQualifier

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

getGlobalTransactionId

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

equals

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

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2011. All Rights Reserved.