| java.lang.Object org.jboss.mq.server.BasicQueue
All known Subclasses: org.jboss.mq.server.ExclusiveQueue, org.jboss.mq.server.PersistentQueue,
BasicQueue | public class BasicQueue (Code) | | This class represents a queue which provides it's messages exclusively to one
consumer at a time.
Notes about synchronization: Much of the work is synchronized on
the receivers or messages depending on the work performed.
However, anything to do with unacknowledged messages and removed
subscriptions must be done synchronized on both (receivers first).
This is because there are multiple entry points with the possibility
that a message acknowledgement (or NACK) is being processed at
the same time as a network failure removes the subscription.
author: Hiram Chirino (Cojonudo14@hotmail.com) author: Norbert Lataille (Norbert.Lataille@m4x.org) author: David Maplesden (David.Maplesden@orion.co.nz) author: Adrian Brock (Adrian@jboss.org) version: $Revision: 61446 $ |
Inner Class :class AddMessagePostRollBackTask implements Runnable | |
Inner Class :class AddMessagePostCommitTask implements Runnable | |
Inner Class :class RestoreMessageTask implements Runnable | |
Inner Class :class RemoveMessageTask implements Runnable | |
Method Summary | |
public void | acknowledge(AcknowledgementRequest item, Tx txId) | public void | addMessage(MessageReference mes, Tx txId) | public void | addReceiver(Subscription sub) | public void | addSubscriber(Subscription sub) | protected void | addToReceivers(Subscription sub) | public SpyMessage[] | browse(String selector) | public List | browseInProcess(String selector) | public List | browseScheduled(String selector) | protected void | clearEvent(MessageReference message) | protected void | clearEvents() | public void | createMessageCounter(String name, String subscription, boolean topic, boolean durable, int daycountmax) | protected void | dropMessage(MessageReference message) | protected void | dropMessage(MessageReference message, Tx txid) | protected void | expireMessage(MessageReference messageRef) | protected void | expireMessageAsync(MessageReference messageRef) Expire a message asynchronously. | public String | getDescription() | public int | getInProcessMessageCount() | public MessageCounter | getMessageCounter() | public int | getQueueDepth() | public ArrayList | getReceivers() | public int | getReceiversCount() | public int | getScheduledMessageCount() | public Set | getSubscribers() | public boolean | isInUse() | protected void | nackMessage(MessageReference message) Nacks a message. | public void | nackMessages(Subscription sub) | protected void | performOrPrepareAcknowledgeMessage(MessageReference mes, Tx txId) | protected void | performOrPrepareAddMessage(MessageReference mes, Tx txId) | protected void | queueMessageForSending(Subscription sub, MessageReference message) | public SpyMessage | receive(Subscription sub, boolean wait) | public void | removeAllMessages() | protected void | removeReceiver(Subscription sub) | public void | removeSubscriber(Subscription sub) | public void | restoreMessage(MessageReference mes) Restores a message. | public void | restoreMessage(MessageReference mes, Tx txid, int type) Restores a message. | protected void | setupMessageAcknowledgement(Subscription sub, MessageReference messageRef) | public void | stop() | public String | toString() |
description | String description(Code) | | The description used to seperate persistence for multiple subscriptions to a topic
|
events | ConcurrentHashMap events(Code) | | Events by message id
|
log | final static Logger log(Code) | | |
messages | SortedSet messages(Code) | | List of messages waiting to be dispatched
synchronized access on itself
|
receivers | Receivers receivers(Code) | | The subscribers waiting for messages - synchronized access on itself
|
removedSubscribers | HashSet removedSubscribers(Code) | | Removed subscribers
synchronized access on receivers and messages
|
scheduledMessages | CopyOnWriteArraySet scheduledMessages(Code) | | The scheduled messages
|
stopped | boolean stopped(Code) | | Have we been stopped
|
subscribers | HashSet subscribers(Code) | | Subscribers
synchronized access on receivers
|
unackedByMessageRef | HashMap unackedByMessageRef(Code) | | Unacknowledged messages MessageRef -> UnackedMessageInfo
synchronized access on receivers and messages
|
unackedBySubscription | HashMap unackedBySubscription(Code) | | Unacknowledged messages Subscription -> UnackedMessageInfo
synchronized access on receivers and messages
|
unacknowledgedMessages | HashMap unacknowledgedMessages(Code) | | Unacknowledged messages AcknowledgementRequest -> UnackedMessageInfo
synchronized access on receivers and messages
|
BasicQueue | public BasicQueue(JMSDestinationManager server, String description, BasicQueueParameters parameters) throws JMSException(Code) | | Construct a new basic queue
Parameters: server - the destination manager Parameters: description - a description to uniquely identify the queue Parameters: parameters - the basic queue parameters throws: JMSException - for any error |
acknowledge | public void acknowledge(AcknowledgementRequest item, Tx txId) throws JMSException(Code) | | Acknowledge a message
Parameters: item - the acknowledgement request Parameters: txId - the transaction throws: JMSException - for any error |
addMessage | public void addMessage(MessageReference mes, Tx txId) throws JMSException(Code) | | Add a message to the queue
Parameters: mes - the message reference Parameters: txId - the transaction throws: JMSException - for any error |
addReceiver | public void addReceiver(Subscription sub) throws JMSException(Code) | | Add a receiver to the queue
Parameters: sub - the subscription to add throws: JMSException - for any error |
addSubscriber | public void addSubscriber(Subscription sub) throws JMSException(Code) | | Add a subscription from the queue
Parameters: sub - the subscription to add throws: JMSException - for any error |
addToReceivers | protected void addToReceivers(Subscription sub) throws JMSException(Code) | | Add a receiver
Parameters: sub - the receiver to add |
browse | public SpyMessage[] browse(String selector) throws JMSException(Code) | | Browse the queue
Parameters: selector - the selector to apply, pass null forall messages the messages throws: JMSException - for any error |
browseInProcess | public List browseInProcess(String selector) throws JMSException(Code) | | Browse the in process messages
Parameters: selector - the selector to apply, pass null forall messages the messages throws: JMSException - for any error |
browseScheduled | public List browseScheduled(String selector) throws JMSException(Code) | | Browse the scheduled messages
Parameters: selector - the selector to apply, pass null forall messages the messages throws: JMSException - for any error |
clearEvent | protected void clearEvent(MessageReference message)(Code) | | Clear the event for a message
Parameters: message - the message reference |
clearEvents | protected void clearEvents()(Code) | | Clear all the events
|
createMessageCounter | public void createMessageCounter(String name, String subscription, boolean topic, boolean durable, int daycountmax)(Code) | | Create message counter object
Parameters: name - topic/queue name Parameters: subscription - topic subscription Parameters: topic - topic flag Parameters: durable - durable subscription flag Parameters: daycountmax - message history day count limit0: disabled,>0: max day count,<0: unlimited |
dropMessage | protected void dropMessage(MessageReference message)(Code) | | Remove a message
Parameters: message - the message to remove |
dropMessage | protected void dropMessage(MessageReference message, Tx txid)(Code) | | Remove a message
Parameters: message - the message to remove Parameters: txid - the transaction context for the removal |
expireMessage | protected void expireMessage(MessageReference messageRef)(Code) | | Expire a message
Parameters: messageRef - the message to remove |
expireMessageAsync | protected void expireMessageAsync(MessageReference messageRef)(Code) | | Expire a message asynchronously.
Parameters: messageRef - the message to remove |
getDescription | public String getDescription()(Code) | | Retrieve the unique description for this queue
the description |
getInProcessMessageCount | public int getInProcessMessageCount()(Code) | | Returns the number of in process messages for the queue
the in process count |
getMessageCounter | public MessageCounter getMessageCounter()(Code) | | Get message counter object
MessageCounter message counter object or null |
getQueueDepth | public int getQueueDepth()(Code) | | Retrieve the queue depth
the number of messages in the queue |
getReceivers | public ArrayList getReceivers()(Code) | | Retrieve the receivers waiting for a message
an array of subscriptions |
getReceiversCount | public int getReceiversCount()(Code) | | Retrieve the number of receivers waiting for a message
the number of receivers |
getScheduledMessageCount | public int getScheduledMessageCount()(Code) | | Returns the number of scheduled messages in the queue
the scheduled message count |
getSubscribers | public Set getSubscribers()(Code) | | Get the subscribers
the subscribers |
isInUse | public boolean isInUse()(Code) | | Test whether the queue is in use
true when there are subscribers |
nackMessages | public void nackMessages(Subscription sub)(Code) | | Nack all messages for a subscription
Parameters: sub - the subscription |
performOrPrepareAcknowledgeMessage | protected void performOrPrepareAcknowledgeMessage(MessageReference mes, Tx txId) throws JMSException(Code) | | Either perform or prepare the acknowledge message
Parameters: mes - the message reference Parameters: txId - the transaction id throws: Exception - for any error |
performOrPrepareAddMessage | protected void performOrPrepareAddMessage(MessageReference mes, Tx txId) throws Exception(Code) | | Either perform or prepare the add message
Parameters: mes - the message reference Parameters: txId - the transaction id throws: Exception - for any error |
queueMessageForSending | protected void queueMessageForSending(Subscription sub, MessageReference message)(Code) | | Queue a message for sending through the client consumer
Parameters: sub - the subscirption to receive the message Parameters: message - the message reference to queue |
receive | public SpyMessage receive(Subscription sub, boolean wait) throws JMSException(Code) | | Receive a message from the queue
Parameters: sub - the subscription requiring a message Parameters: wait - whether to wait for a message the message throws: JMSException - for any error |
removeAllMessages | public void removeAllMessages() throws JMSException(Code) | | |
removeReceiver | protected void removeReceiver(Subscription sub)(Code) | | Remove a receiver
Parameters: sub - the receiver to remove |
removeSubscriber | public void removeSubscriber(Subscription sub)(Code) | | Removes a subscription from the queue
Parameters: sub - the subscription to remove |
restoreMessage | public void restoreMessage(MessageReference mes)(Code) | | Restores a message.
Parameters: mes - the message reference |
restoreMessage | public void restoreMessage(MessageReference mes, Tx txid, int type)(Code) | | Restores a message.
Parameters: mes - the message reference Parameters: txid - the transaction id Parameters: type - the type of restoration |
setupMessageAcknowledgement | protected void setupMessageAcknowledgement(Subscription sub, MessageReference messageRef) throws JMSException(Code) | | Setup a message acknowledgement
Parameters: sub - the subscription receiving the message Parameters: messageRef - the message to be acknowledged throws: JMSException - for any error |
|
|