Package net.timewalker.ffmq4.local
Class TransactionSet
- java.lang.Object
-
- net.timewalker.ffmq4.local.TransactionSet
-
public final class TransactionSet extends Object
Set of
TransactionItemobjects. Used by the JMSSessionimplementation to keep track of the changes made in the current transaction. May be fully or partially cleared on commit/rollback operations. Thread-safe implementation.
-
-
Constructor Summary
Constructors Constructor Description TransactionSet()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int handle, String messageID, int deliveryMode, LocalQueue destination)Add an handle to the listvoidadd(TransactionItem item)Add an handle to the listTransactionItem[]clear()Clear the set and return a snapshot of its contentTransactionItem[]clear(List<String> deliveredMessageIDs)Clear items by IDs from the transaction set and return a snapshot of the itemsvoidremoveUpdatesForQueue(String queueName)Remove all pending updates for the given queueintsize()Get the list sizeList<LocalQueue>updatedQueues()Compute a list of queues that were updated in this transaction setList<LocalQueue>updatedQueues(List<String> deliveredMessageIDs)Compute a list of queues that were updated in this transaction set
-
-
-
Method Detail
-
add
public void add(int handle, String messageID, int deliveryMode, LocalQueue destination)Add an handle to the list- Parameters:
handle-
-
add
public void add(TransactionItem item)
Add an handle to the list- Parameters:
item- the transaction item
-
removeUpdatesForQueue
public void removeUpdatesForQueue(String queueName)
Remove all pending updates for the given queue- Parameters:
queueName- the queue name
-
size
public int size()
Get the list size- Returns:
- the list size
-
clear
public TransactionItem[] clear(List<String> deliveredMessageIDs) throws FFMQException
Clear items by IDs from the transaction set and return a snapshot of the items- Throws:
FFMQException
-
clear
public TransactionItem[] clear()
Clear the set and return a snapshot of its content
-
updatedQueues
public List<LocalQueue> updatedQueues()
Compute a list of queues that were updated in this transaction set
-
updatedQueues
public List<LocalQueue> updatedQueues(List<String> deliveredMessageIDs) throws FFMQException
Compute a list of queues that were updated in this transaction set- Throws:
FFMQException
-
-