Package com.swiftmq.swiftlet.queue
Class QueuePushTransaction
- java.lang.Object
-
- com.swiftmq.swiftlet.queue.QueueTransaction
-
- com.swiftmq.swiftlet.queue.QueuePushTransaction
-
- All Implemented Interfaces:
Recyclable
public class QueuePushTransaction extends QueueTransaction
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:
QueueSender.createTransaction()
-
-
Constructor Summary
Constructors Constructor Description QueuePushTransaction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit(AsyncCompletionCallback callback)
Asynchronously commits the transaction and set the transaction state to closedlong
getFlowControlDelay()
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
hasSpaceLeft()
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
rollback(XidImpl globalTransactionId, boolean setRedelivered)
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
-
-
-
-
Method Detail
-
getFlowControlDelay
public long getFlowControlDelay()
Returns the flow control delay, computed after the transaction has been committed.- Returns:
- flow control delay.
-
hasReceiver
public boolean hasReceiver(MessageImpl message)
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
public void putMessage(MessageImpl message) throws QueueException, QueueTransactionClosedException
Put a message into the queue- Parameters:
message
- the message- Throws:
QueueException
- thrown by the queueQueueTransactionClosedException
- if the transaction is closed
-
commit
public void commit(AsyncCompletionCallback callback)
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
public void rollback() throws QueueException, QueueTransactionClosedException
Rollback of the transaction.- Specified by:
rollback
in classQueueTransaction
- Throws:
QueueException
- thrown by the queueQueueTransactionClosedException
- if the transaction is closed
-
rollback
public void rollback(AsyncCompletionCallback callback)
Asynchronous rollback of the transaction.- Parameters:
callback
- async completion callback
-
-