public final class PriorityMessageQueue extends Object implements MessageQueue
enqueueFirst(org.apache.qpid.jms.message.JmsInboundMessageDispatch) is
used.| Modifier and Type | Field and Description |
|---|---|
protected static int |
CLOSED |
protected Object |
lock |
protected static int |
RUNNING |
protected static AtomicIntegerFieldUpdater<PriorityMessageQueue> |
STATE_FIELD_UPDATER |
protected static int |
STOPPED |
| Constructor and Description |
|---|
PriorityMessageQueue() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the Queue of any Messages.
|
void |
close()
Closes the Message Queue.
|
JmsInboundMessageDispatch |
dequeue(long timeout)
Used to get an enqueued message.
|
JmsInboundMessageDispatch |
dequeueNoWait()
Used to get an enqueued Message if on exists, otherwise returns null.
|
void |
enqueue(JmsInboundMessageDispatch envelope)
Adds the given message envelope to the end of the Message queue.
|
void |
enqueueFirst(JmsInboundMessageDispatch envelope)
Adds the given message envelope to the front of the Message queue.
|
boolean |
isClosed() |
boolean |
isEmpty() |
boolean |
isRunning() |
int |
size()
Returns the number of Messages currently in the Queue.
|
void |
start()
Starts the Message Queue.
|
void |
stop()
Stops the Message Queue.
|
protected static final AtomicIntegerFieldUpdater<PriorityMessageQueue> STATE_FIELD_UPDATER
protected static final int CLOSED
protected static final int STOPPED
protected static final int RUNNING
protected final Object lock
public void enqueue(JmsInboundMessageDispatch envelope)
MessageQueueenqueue in interface MessageQueueenvelope - The in-bound Message envelope to enqueue.public void enqueueFirst(JmsInboundMessageDispatch envelope)
MessageQueueenqueueFirst in interface MessageQueueenvelope - The in-bound Message envelope to enqueue.public final JmsInboundMessageDispatch dequeue(long timeout) throws InterruptedException
MessageQueuedequeue in interface MessageQueuetimeout - The amount of time to wait for an entry to be added before returning null.InterruptedException - if the wait is interrupted.public final JmsInboundMessageDispatch dequeueNoWait()
MessageQueuedequeueNoWait in interface MessageQueuepublic final void start()
MessageQueuestart in interface MessageQueuepublic final void stop()
MessageQueuestop in interface MessageQueuepublic final void close()
MessageQueueclose in interface MessageQueuepublic final boolean isRunning()
isRunning in interface MessageQueuepublic final boolean isClosed()
isClosed in interface MessageQueuepublic boolean isEmpty()
isEmpty in interface MessageQueuepublic int size()
MessageQueuesize in interface MessageQueuepublic void clear()
MessageQueueclear in interface MessageQueueCopyright © 2013–2019 The Apache Software Foundation. All rights reserved.