public class Xid
extends java.lang.Object
implements java.io.Externalizable
ReplicationReceiver.commit(Xid)
is called.
A transaction is identified by its creator and a transaction ID. The creator is currently a JGroups address, consisting of the IP address and port of the member.
Note that this class might be replaced in the future with the real JTA counterpart.
Revisions:
Dec 28 2002 Bela Ban: first implementation
Modifier and Type | Field and Description |
---|---|
protected Address |
creator |
static int |
DIRTY_READS
Writes are serialized, but reads can be dirty; e.g., a data might have
been changed while we read it.
|
protected long |
id |
protected int |
mode |
protected static long |
next_id |
static int |
READ_COMMITTED
Reads are dirty until another transaction actually commits; at that
points the modified data will be reflected here.
|
static int |
REPEATABLE_READ
Each read causes the data read to be copied to the private workspace, so
subsequent reads always read the private data.
|
static int |
SERIALIZABLE
Reads and writes require locks.
|
static java.lang.String |
XID |
Constructor and Description |
---|
Xid() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
static Xid |
create(Address creator) |
static Xid |
create(Address creator,
int mode) |
boolean |
equals(java.lang.Object other) |
Address |
getCreator() |
long |
getId() |
long |
getMode() |
int |
hashCode() |
static java.lang.String |
modeToString(int m) |
void |
readExternal(java.io.ObjectInput in) |
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
protected Address creator
protected long id
protected int mode
protected static transient long next_id
public static final java.lang.String XID
public static final int DIRTY_READS
public static final int READ_COMMITTED
public static final int REPEATABLE_READ
public static final int SERIALIZABLE
public Address getCreator()
public long getId()
public long getMode()
public static Xid create(Address creator) throws java.lang.Exception
java.lang.Exception
public static Xid create(Address creator, int mode) throws java.lang.Exception
java.lang.Exception
public static java.lang.String modeToString(int m)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object o)
public java.lang.String toString()
toString
in class java.lang.Object
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
Copyright ? 1998-2006 Bela Ban. All Rights Reserved.