|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.utils.UidGenerator
Helper that offers UID generation (GTRID, XID, sequences) needed by the transaction manager.
Generated UIDs are at most 64 bytes long and are made of 3 subparts: the current time in milliseconds since
Epoch, a JVM transient atomic sequence number and the configured bitronix.tm.serverId
.
The reliance on the system clock is critical to the uniqueness of the UID in the network so you have to make sure all servers of the network running this transaction manager have their clock reasonably in sync. An order of 1 second synchronicity is generally fine.
Constructor Summary | |
UidGenerator()
|
Method Summary | |
static Uid |
generateUid()
Generate a UID, globally unique. |
static BitronixXid |
generateXid(Uid gtrid)
Generate a XID with the specified globalTransactionId. |
static int |
getNextSequenceNumber()
Atomically generate general-purpose sequence numbers starting at 0. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UidGenerator()
Method Detail |
public static Uid generateUid()
public static int getNextSequenceNumber()
public static BitronixXid generateXid(Uid gtrid)
gtrid
- the GTRID to use to generate the Xid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |