Class CompositeQueue
- java.lang.Object
-
- com.swiftmq.swiftlet.queue.AbstractQueue
-
- com.swiftmq.impl.queue.standard.composite.CompositeQueue
-
public class CompositeQueue extends AbstractQueue
-
-
Field Summary
-
Fields inherited from class com.swiftmq.swiftlet.queue.AbstractQueue
ACTIVESTANDBY, AS_MESSAGE, cleanUpInterval, consumerMode, EXCLUSIVE, flowController, maxMessages, NON_PERSISTENT, persistenceMode, PERSISTENT, receiverCount, SHARED, temporary
-
-
Constructor Summary
Constructors Constructor Description CompositeQueue(SwiftletContext ctx, Entity compositeQueueEntity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit(java.lang.Object object)
Commit the transaction with the given transaction idvoid
commit(java.lang.Object object, XidImpl xid)
Commits a prepared transaction.void
commit(java.lang.Object object, AsyncCompletionCallback callback)
Asynchronously commits the transaction with the given transaction idjava.lang.Object
createPullTransaction()
Creates a new pull transaction and returns a unique transaction idjava.lang.Object
createPushTransaction()
Creates a new push transaction and returns a unique transaction idvoid
deleteContent()
Removes all messages from the queue.boolean
hasReceiver(MessageImpl message)
Checks all registered receivers and, if set, their message selectors whether this message will be received by one of them.void
lockQueue(java.lang.Object object)
Locks this queue and holds it until unlockQueue is called.void
prepare(java.lang.Object object, XidImpl xid)
Prepares the transaction with the given transaction id.void
putMessage(java.lang.Object object, MessageImpl message)
Put a message into the queuevoid
rollback(java.lang.Object object, boolean setRedelivered)
Rolls back the transaction with the given transaction id.void
rollback(java.lang.Object object, boolean setRedelivered, AsyncCompletionCallback callback)
Asynchronously rolls back the transaction with the given transaction id.void
rollback(java.lang.Object object, XidImpl xid, boolean setRedelivered)
Rolls back the transaction with the given transaction id, eventually prepared under a global transaction id.void
setCompositeStoreTransaction(java.lang.Object object, CompositeStoreTransaction ct)
Sets a CompositeStoreTransaction to be used as the current transaction.void
startQueue()
Starts the queue.void
stopQueue()
Stops the queue.void
unlockQueue(java.lang.Object object, boolean markAsyncActive)
Unlocks this queue.-
Methods inherited from class com.swiftmq.swiftlet.queue.AbstractQueue
acknowledgeMessage, acknowledgeMessage, acknowledgeMessages, addWireTapSubscriber, buildPreparedTransaction, cleanUpExpiredMessages, createView, decReceiverCount, deleteView, flushAccounting, getCacheSize, getCacheSizeKB, getCleanUpInterval, getCompositeStoreTransaction, getConsumedTotal, getConsumerMode, getConsumingRate, getCurrentCacheSizeKB, getCurrentCacheSizeMessages, getExpiredMessage, getFlowController, getIndexEntry, getLocalName, getMaxMessages, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessageByIndex, getMonitorAlertThreshold, getNumberQueueMessages, getPersistenceMode, getProducedTotal, getProducingRate, getQueueIndex, getQueueIndex, getQueueName, getQueueReceiverListener, getReceiverCount, incReceiverCount, isAccounting, isRunning, isTemporary, moveToTransaction, moveToTransaction, moveToTransactionReturnSize, moveToTransactionReturnSize, receiverClosed, registerMessageProcessor, removeMessageByIndex, removeMessages, removeWireTapSubscriber, resetCounters, selectBaseQueue, setCleanUpInterval, setConsumerMode, setFlowController, setLocalName, setMaxMessages, setPersistenceMode, setQueueName, setQueueReceiverListener, setTemporary, startAccounting, stopAccounting, timeoutMessageProcessor, unmarkAsyncActive, unregisterMessageProcessor
-
-
-
-
Constructor Detail
-
CompositeQueue
public CompositeQueue(SwiftletContext ctx, Entity compositeQueueEntity)
-
-
Method Detail
-
lockQueue
public void lockQueue(java.lang.Object object)
Description copied from class:AbstractQueue
Locks this queue and holds it until unlockQueue is called.- Overrides:
lockQueue
in classAbstractQueue
- Parameters:
object
- local transactionId
-
unlockQueue
public void unlockQueue(java.lang.Object object, boolean markAsyncActive)
Description copied from class:AbstractQueue
Unlocks this queue.- Overrides:
unlockQueue
in classAbstractQueue
- Parameters:
object
- local transactionIdmarkAsyncActive
- blocks queue as async is active
-
setCompositeStoreTransaction
public void setCompositeStoreTransaction(java.lang.Object object, CompositeStoreTransaction ct)
Description copied from class:AbstractQueue
Sets a CompositeStoreTransaction to be used as the current transaction. At the same time it disables prepare/commit/rollback calls inside this queue so that multiple queues can use the same transaction and prepare/commit/rollback is done outside.- Overrides:
setCompositeStoreTransaction
in classAbstractQueue
- Parameters:
object
- local transactionIdct
- composite transaction
-
hasReceiver
public boolean hasReceiver(MessageImpl message)
Description copied from class:AbstractQueue
Checks all registered receivers and, if set, their message selectors whether this message will be received by one of them.- Specified by:
hasReceiver
in classAbstractQueue
- Returns:
- has receiver or not
-
createPushTransaction
public java.lang.Object createPushTransaction() throws QueueException
Description copied from class:AbstractQueue
Creates a new push transaction and returns a unique transaction id- Specified by:
createPushTransaction
in classAbstractQueue
- Returns:
- transaction id
- Throws:
QueueException
- on error
-
createPullTransaction
public java.lang.Object createPullTransaction() throws QueueException
Description copied from class:AbstractQueue
Creates a new pull transaction and returns a unique transaction id- Specified by:
createPullTransaction
in classAbstractQueue
- Returns:
- transaction id
- Throws:
QueueException
- on error
-
putMessage
public void putMessage(java.lang.Object object, MessageImpl message) throws QueueException
Description copied from class:AbstractQueue
Put a message into the queue- Specified by:
putMessage
in classAbstractQueue
- Parameters:
object
- a valid push transaction idmessage
- the message- Throws:
QueueException
- on error
-
prepare
public void prepare(java.lang.Object object, XidImpl xid) throws QueueException
Description copied from class:AbstractQueue
Prepares the transaction with the given transaction id. Messages are stored in the queue (on disk when persistent) but not unlocked. The preparation is logged under the global transaction id.- Specified by:
prepare
in classAbstractQueue
- Parameters:
object
- local transaction idxid
- global transaction id- Throws:
QueueException
- on error
-
commit
public void commit(java.lang.Object object, XidImpl xid) throws QueueException
Description copied from class:AbstractQueue
Commits a prepared transaction.- Specified by:
commit
in classAbstractQueue
- Parameters:
object
- local transaction idxid
- global transaction id- Throws:
QueueException
- on error
-
commit
public void commit(java.lang.Object object) throws QueueException
Description copied from class:AbstractQueue
Commit the transaction with the given transaction id- Specified by:
commit
in classAbstractQueue
- Parameters:
object
- transaction id- Throws:
QueueException
- on error
-
commit
public void commit(java.lang.Object object, AsyncCompletionCallback callback)
Description copied from class:AbstractQueue
Asynchronously commits the transaction with the given transaction id- Specified by:
commit
in classAbstractQueue
- Parameters:
object
- transaction idcallback
- async completion callback
-
rollback
public void rollback(java.lang.Object object, XidImpl xid, boolean setRedelivered) throws QueueException
Description copied from class:AbstractQueue
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 classAbstractQueue
- Parameters:
object
- transaction idxid
- global transaction idsetRedelivered
- specifies JMS redelivery setting- Throws:
QueueException
- on error
-
rollback
public void rollback(java.lang.Object object, boolean setRedelivered) throws QueueException
Description copied from class:AbstractQueue
Rolls back the transaction with the given 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 classAbstractQueue
- Parameters:
object
- transaction idsetRedelivered
- specifies JMS redelivery setting- Throws:
QueueException
- on error
-
rollback
public void rollback(java.lang.Object object, boolean setRedelivered, AsyncCompletionCallback callback)
Description copied from class:AbstractQueue
Asynchronously rolls back the transaction with the given 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 classAbstractQueue
- Parameters:
object
- transaction idsetRedelivered
- specifies JMS redelivery settingcallback
- async completion callback
-
deleteContent
public void deleteContent() throws QueueException
Description copied from class:AbstractQueue
Removes all messages from the queue.- Overrides:
deleteContent
in classAbstractQueue
- Throws:
QueueException
- on error
-
startQueue
public void startQueue() throws QueueException
Description copied from class:AbstractQueue
Starts the queue.- Overrides:
startQueue
in classAbstractQueue
- Throws:
QueueException
- on error
-
stopQueue
public void stopQueue() throws QueueException
Description copied from class:AbstractQueue
Stops the queue.- Overrides:
stopQueue
in classAbstractQueue
- Throws:
QueueException
- on error
-
-