Package com.swiftmq.swiftlet.queue
Class QueuePushTransaction
java.lang.Object
com.swiftmq.swiftlet.queue.QueueTransaction
com.swiftmq.swiftlet.queue.QueuePushTransaction
- All Implemented Interfaces:
Recyclable
Transaction to push messages into a queue. It is created by a QueueSender
- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit
(AsyncCompletionCallback callback) Asynchronously commits the transaction and set the transaction state to closedlong
Returns the flow control delay, computed after the transaction has been committed.boolean
hasReceiver
(MessageImpl message) Checks all registered receivers and, if set, their message selectors whether this message will be received by one of them.boolean
Check whether the queue has enough space to store the number of messages in the transactionvoid
putMessage
(MessageImpl message) Put a message into the queuevoid
rollback()
Rollback of the transaction.void
Rolls back the transaction with the given transaction id, eventually prepared under a global transaction id.void
rollback
(AsyncCompletionCallback callback) Asynchronous rollback of the transaction.Methods inherited from class com.swiftmq.swiftlet.queue.QueueTransaction
commit, commit, getAbstractQueue, getCompositeStoreTransaction, getQueue, getQueueName, getRecycleIndex, isClosed, isDoRollbackOnClose, isPrepared, isQueueRunning, isTemporaryQueue, lockQueue, prepare, reset, setCompositeStoreTransaction, setDoRollbackOnClose, setRecycleIndex, unlockQueue, unmarkAsyncActive, verifyTransactionState
-
Constructor Details
-
QueuePushTransaction
public QueuePushTransaction()
-
-
Method Details
-
getFlowControlDelay
public long getFlowControlDelay()Returns the flow control delay, computed after the transaction has been committed.- Returns:
- flow control delay.
-
hasReceiver
Checks all registered receivers and, if set, their message selectors whether this message will be received by one of them.- Parameters:
message
-- Returns:
- has receiver or not
-
hasSpaceLeft
public boolean hasSpaceLeft()Check whether the queue has enough space to store the number of messages in the transaction- Returns:
- true/false
-
putMessage
Put a message into the queue- Parameters:
message
- the message- Throws:
QueueException
- thrown by the queueQueueTransactionClosedException
- if the transaction is closed
-
commit
Asynchronously commits the transaction and set the transaction state to closed- Parameters:
callback
- async completion callback
-
rollback
public void rollback(XidImpl globalTransactionId, boolean setRedelivered) throws QueueException, QueueTransactionClosedException Rolls back the transaction with the given transaction id, eventually prepared under a global transaction id. If the flagsetRedelivered
is set then the JMS properties for redelivery and delivery count of messages pulled within this transaction are updated.- Specified by:
rollback
in classQueueTransaction
- Parameters:
globalTransactionId
- global transaction idsetRedelivered
- specifies JMS redelivery setting- Throws:
QueueException
- on errorQueueTransactionClosedException
-
rollback
Rollback of the transaction.- Specified by:
rollback
in classQueueTransaction
- Throws:
QueueException
- thrown by the queueQueueTransactionClosedException
- if the transaction is closed
-
rollback
Asynchronous rollback of the transaction.- Parameters:
callback
- async completion callback
-