|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mq.server.BasicQueue
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.
Constructor Summary | |
BasicQueue(JMSDestinationManager server,
String description,
BasicQueueParameters parameters)
Construct a new basic queue |
Method Summary | |
void |
acknowledge(AcknowledgementRequest item,
Tx txId)
Acknowledge a message |
void |
addMessage(MessageReference mes,
Tx txId)
Add a message to the queue |
void |
addReceiver(Subscription sub)
Add a receiver to the queue |
void |
addSubscriber(Subscription sub)
Add a subscription from the queue |
protected void |
addToReceivers(Subscription sub)
Add a receiver |
SpyMessage[] |
browse(String selector)
Browse the queue |
protected void |
clearEvent(MessageReference message)
Clear the event for a message |
protected void |
clearEvents()
Clear all the events |
void |
createMessageCounter(String name,
String subscription,
boolean topic,
boolean durable,
int daycountmax)
Create message counter object |
protected void |
dropMessage(MessageReference message)
Remove a message |
protected void |
dropMessage(MessageReference message,
Tx txid)
Remove a message |
String |
getDescription()
Retrieve the unique description for this queue |
MessageCounter |
getMessageCounter()
Get message counter object |
int |
getQueueDepth()
Retrieve the queue depth |
ArrayList |
getReceivers()
Retrieve the receivers waiting for a message |
int |
getReceiversCount()
Retrieve the number of receivers waiting for a message |
int |
getScheduledMessageCount()
Returns the number of scheduled messages in the queue |
boolean |
isInUse()
Test whether the queue is in use |
void |
nackMessages(Subscription sub)
Nack all messages for a subscription |
protected void |
queueMessageForSending(Subscription sub,
MessageReference message)
Queue a message for sending through the client consumer |
SpyMessage |
receive(Subscription sub,
boolean wait)
Receive a message from the queue |
void |
removeAllMessages()
|
protected void |
removeReceiver(Subscription sub)
Remove a receiver |
void |
removeSubscriber(Subscription sub)
Removes a subscription from the queue |
void |
restoreMessage(MessageReference mes)
Restores a message. |
protected void |
setupMessageAcknowledgement(Subscription sub,
MessageReference messageRef)
Setup a message acknowledgement |
void |
stop()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BasicQueue(JMSDestinationManager server, String description, BasicQueueParameters parameters) throws javax.jms.JMSException
server
- the destination managerdescription
- a description to uniquely identify the queueparameters
- the basic queue parametersMethod Detail |
public String getDescription()
public int getReceiversCount()
public ArrayList getReceivers()
public boolean isInUse()
public void addReceiver(Subscription sub) throws javax.jms.JMSException
sub
- the subscription to add
javax.jms.JMSException
public void addSubscriber(Subscription sub) throws javax.jms.JMSException
sub
- the subscription to add
javax.jms.JMSException
public void removeSubscriber(Subscription sub)
sub
- the subscription to removepublic int getQueueDepth()
public int getScheduledMessageCount()
public void addMessage(MessageReference mes, Tx txId) throws javax.jms.JMSException
mes
- the message referencetxId
- the transaction
javax.jms.JMSException
- for any errorpublic void restoreMessage(MessageReference mes)
public SpyMessage[] browse(String selector) throws javax.jms.JMSException
selector
- the selector to apply, pass null for
all messages
javax.jms.JMSException
- for any errorpublic SpyMessage receive(Subscription sub, boolean wait) throws javax.jms.JMSException
wait
- whether to wait for a message
javax.jms.JMSException
- for any errorpublic void acknowledge(AcknowledgementRequest item, Tx txId) throws javax.jms.JMSException
item
- the acknowledgement request
javax.jms.JMSException
- for any errorpublic void nackMessages(Subscription sub)
sub
- the subscriptionpublic void removeAllMessages() throws javax.jms.JMSException
javax.jms.JMSException
public void stop()
public void createMessageCounter(String name, String subscription, boolean topic, boolean durable, int daycountmax)
name
- topic/queue namesubscription
- topic subscriptiontopic
- topic flagdurable
- durable subscription flagdaycountmax
- message history day count limit
0: disabled,
>0: max day count,
<0: unlimitedpublic MessageCounter getMessageCounter()
public String toString()
protected void clearEvents()
protected void clearEvent(MessageReference message)
message
- the message referenceprotected void addToReceivers(Subscription sub) throws javax.jms.JMSException
sub
- the receiver to add
javax.jms.JMSException
protected void removeReceiver(Subscription sub)
sub
- the receiver to removeprotected void queueMessageForSending(Subscription sub, MessageReference message)
sub
- the subscirption to receive the messagemessage
- the message reference to queueprotected void setupMessageAcknowledgement(Subscription sub, MessageReference messageRef) throws javax.jms.JMSException
sub
- the subscription receiving the messagemessageRef
- the message to be acknowledged
javax.jms.JMSException
- for any errorprotected void dropMessage(MessageReference message)
message
- the message to removeprotected void dropMessage(MessageReference message, Tx txid)
message
- the message to removetxid
- the transaction context for the removal
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |