org.jgroups.blocks
Class Xid
- Externalizable
public class Xid
extends java.lang.Object
implements Externalizable
Distributed transaction ID modeled after the JTA spec. This is used to
identify entities of work, with which resources are associated. A transaction
will thus trigger the creation of an associated entry on each receiver, which
keeps track of resources acquired and their locks, operations to be committed
in case
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.
$Revision: 1.5 $
Revisions:
Dec 28 2002 Bela Ban: first implementation
static int | DIRTY_READS - Writes are serialized, but reads can be dirty; e.g., a data might have
been changed while we read it.
|
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 String | XID
|
protected Address | creator
|
protected long | id
|
protected int | mode
|
protected static long | next_id
|
DIRTY_READS
public static final int DIRTY_READS
Writes are serialized, but reads can be dirty; e.g., a data might have
been changed while we read it. This is fast because we don't need to
acquire locks for reads.
READ_COMMITTED
public static final int READ_COMMITTED
Reads are dirty until another transaction actually commits; at that
points the modified data will be reflected here.
REPEATABLE_READ
public static final int REPEATABLE_READ
Each read causes the data read to be copied to the private workspace, so
subsequent reads always read the private data.
SERIALIZABLE
public static final int SERIALIZABLE
Reads and writes require locks. This is very costly, and is not
recommended (and currently not implemented either :-)).
XID
public static final String XID
next_id
protected static long next_id
compareTo
public int compareTo(Object o)
create
public static Xid create(Address creator)
throws Exception
create
public static Xid create(Address creator,
int mode)
throws Exception
equals
public boolean equals(Object other)
getCreator
public Address getCreator()
getMode
public long getMode()
hashCode
public int hashCode()
modeToString
public static String modeToString(int m)
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
toString
public String toString()
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
Copyright B) 1998-2005 Bela Ban. All Rights Reserved.