2
* Copyright 2003-2010 Terracotta, Inc.
2
* Copyright Terracotta, Inc.
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
31
34
* Create a unique transaction ID
32
36
* @return a transaction ID
34
38
TransactionID createTransactionID();
41
* Restore a transaction ID from its serialized form
43
* @param serializedForm the TransactionID serialized form
44
* @return the restored TransactionID
46
TransactionID restoreTransactionID(TransactionIDSerializedForm serializedForm);
37
49
* Create a transaction ID based on a XID for uniqueness
38
51
* @param xid the XID
39
52
* @return a transaction ID
41
XidTransactionID createXidTransactionID(Xid xid);
54
XidTransactionID createXidTransactionID(Xid xid, Ehcache cache);
57
* Restore a XID transaction ID from its serialized form
59
* @param serializedForm the XidTransactionID serialized form
60
* @return the restored XidTransactionID
62
XidTransactionID restoreXidTransactionID(XidTransactionIDSerializedForm serializedForm);
65
* Mark that this transaction's decision is commit
67
* @param transactionID transaction to be marked
69
void markForCommit(TransactionID transactionID);
72
* Mark this transaction ID for rollback
74
void markForRollback(XidTransactionID transactionID);
77
* Check if the given transaction should be committed or not
79
* @param transactionID transaction to be queried
80
* @return true if the transaction should be committed
82
boolean isDecisionCommit(TransactionID transactionID);
85
* Clear this transaction's state representation.
87
* @param transactionID transaction to be cleared
89
void clear(TransactionID transactionID);
92
* Get the set of all XID transactions of a cache.
94
* @return the set of transactions
96
Set<XidTransactionID> getAllXidTransactionIDsFor(Ehcache cache);
99
* Get the set of all known transactions.
101
* @return the set of transactions
103
Set<TransactionID> getAllTransactionIDs();
106
* Return {@code true} if the factory state is persistent (survives JVM restart).
108
* @return {@code true} is state is persistent
110
Boolean isPersistent();
113
* Check if the transaction ID expired, ie: that the transaction died abnormally
115
* @return true if the transaction ID expired and should be cleaned up, false otherwise
117
boolean isExpired(TransactionID transactionID);