|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.message.ActiveMQXid
public class ActiveMQXid
A ActiveMQXid
object holds the distributed
transaction id that is passed around in an ActiveMQ system.
Eventhough a Transaction Manager (TM) has his own Xid implementation that he uses when he talks to the our ActiveMQXAResource, we need to send the Xid data down to the server in our format.
ActiveMQ uses Strings as the transaction id. This class coverts an Xid to and from a string.
Xid
,
Serialized FormField Summary |
---|
Fields inherited from interface javax.transaction.xa.Xid |
---|
MAXBQUALSIZE, MAXGTRIDSIZE |
Constructor Summary | |
---|---|
ActiveMQXid()
This constructor is only used for serialization |
|
ActiveMQXid(byte[] data)
|
|
ActiveMQXid(int formatId,
byte[] branchQualifier,
byte[] globalTransactionId)
|
|
ActiveMQXid(String txid)
Creates a new ActiveMQXid object. |
|
ActiveMQXid(Xid xid)
Creates a new ActiveMQXid object with the Xid data contained in xid |
Method Summary | |
---|---|
protected int |
compareTo(byte[] left,
byte[] right)
|
int |
compareTo(Object object)
|
static boolean |
equals(byte[] left,
byte[] right)
|
boolean |
equals(Object that)
|
static boolean |
equals(Xid tis,
Xid that)
Test for equivlance between two Xid |
static ActiveMQXid |
fromBytes(byte[] data)
Deserializes the data into an Xid |
byte[] |
getBranchQualifier()
|
int |
getFormatId()
|
byte[] |
getGlobalTransactionId()
|
protected int |
hash(byte[] bytes,
int hash)
|
int |
hashCode()
|
static ActiveMQXid |
read(DataInput dataIn)
Reads the Xid from a stream |
protected static byte[] |
readBytes(DataInput dataIn)
|
void |
readExternal(ObjectInput in)
|
void |
readState(DataInput dataIn)
|
byte[] |
toBytes()
|
static byte[] |
toBytesFromHex(String hex)
|
static String |
toHexFromBytes(byte[] bytes)
|
String |
toLocalTransactionId()
|
String |
toString()
|
static Object |
transactionIDFromString(String text)
A helper method for the OpenWire protocol to convert a local or XA transaction ID string into an object |
static String |
transactionIDToString(Object transactionID)
A helper method for the OpenWire protocol to convert a local or XA transaction ID object into a String |
void |
write(DataOutput dataOut)
Writes the Xid to a stream |
protected void |
writeBytes(DataOutput dataOut,
byte[] data)
|
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ActiveMQXid()
public ActiveMQXid(Xid xid)
xid
public ActiveMQXid(int formatId, byte[] branchQualifier, byte[] globalTransactionId)
public ActiveMQXid(byte[] data) throws IOException
IOException
public ActiveMQXid(String txid) throws JMSException
JMSException
Method Detail |
---|
public static ActiveMQXid fromBytes(byte[] data) throws IOException
data
-
IOException
public static String transactionIDToString(Object transactionID) throws IOException
IOException
public static Object transactionIDFromString(String text) throws IOException
IOException
public int hashCode()
hashCode
in class Object
public boolean equals(Object that)
equals
in class Object
public static boolean equals(Xid tis, Xid that)
tis
- that
-
public int compareTo(Object object)
compareTo
in interface Comparable
public String toLocalTransactionId()
public byte[] getBranchQualifier()
getBranchQualifier
in interface Xid
Xid.getBranchQualifier()
public int getFormatId()
getFormatId
in interface Xid
Xid.getFormatId()
public byte[] getGlobalTransactionId()
getGlobalTransactionId
in interface Xid
Xid.getGlobalTransactionId()
public String toString()
toString
in class Object
Object.toString()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void readState(DataInput dataIn) throws IOException
IOException
public static ActiveMQXid read(DataInput dataIn) throws IOException
dataIn
-
IOException
public byte[] toBytes() throws IOException
IOException
public void write(DataOutput dataOut) throws IOException
dataOut
-
IOException
protected void writeBytes(DataOutput dataOut, byte[] data) throws IOException
IOException
protected static byte[] readBytes(DataInput dataIn) throws IOException
IOException
public static boolean equals(byte[] left, byte[] right)
protected int compareTo(byte[] left, byte[] right)
protected int hash(byte[] bytes, int hash)
public static byte[] toBytesFromHex(String hex)
hex
-
public static String toHexFromBytes(byte[] bytes)
bytes
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |