public abstract class AbstractQueue<E> extends AbstractDestination<E> implements Queue, MessageQueue<E>, java.util.concurrent.BlockingQueue<E>
Modifier | Constructor and Description |
---|---|
protected |
AbstractQueue() |
Modifier and Type | Method and Description |
---|---|
void |
acknowledge(java.lang.String msgId)
Acknowledge receipt of the message.
|
void |
addListenerException(java.lang.Exception e)
Called when a listener throws an excepton
|
void |
addMessageCallback(MessageCallback<E> callback,
boolean isAutoAck)
Adds the callback to the listening list.
|
void |
close() |
int |
drainTo(java.util.Collection<? super E> c) |
int |
drainTo(java.util.Collection<? super E> c,
int max) |
java.util.ArrayList<? extends QueueEntry<E>> |
getBrowserList() |
int |
getConsumerCount()
Returns the number of active message consumers
|
long |
getListenerFailCountTotal()
Returns the number of listener failures.
|
long |
getListenerFailLastTime()
Returns the number of listener failures.
|
int |
getQueueSize()
Returns the queue size
|
int |
getReceiverCount()
Returns the number of receivers.
|
protected void |
init() |
java.util.Iterator<E> |
iterator() |
boolean |
offer(E message) |
boolean |
offer(E message,
long timeout,
java.util.concurrent.TimeUnit unit)
Adds the item to the queue, waiting if necessary
|
E |
peek() |
E |
poll() |
E |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
postConstruct() |
void |
put(E value) |
E |
receive(long expireTime,
boolean isAutoAcknowledge)
Receives a message, blocking until expireTime if no message is
available.
|
E |
receive(long expireTime,
boolean isAutoAcknowledge,
QueueEntrySelector selector) |
void |
receive(long expireTime,
boolean isAutoAck,
QueueEntrySelector selector,
MessageCallback callback) |
QueueEntry<E> |
receiveEntry(long expireTime,
boolean isAutoAck)
Primary message receiving, registers a callback for any new
message.
|
QueueEntry<E> |
receiveEntry(long expireTime,
boolean isAutoAck,
QueueEntrySelector selector) |
int |
remainingCapacity() |
void |
removeMessageCallback(MessageCallback<E> entryCallback)
Removes the callback from the listening list.
|
void |
rollback(java.lang.String msgId)
Rollback the message read.
|
void |
setQueueName(java.lang.String name) |
int |
size() |
E |
take() |
generateMessageID, generateMessageID, getJMSDestination, getName, getQueueName, getTopicName, getUrl, hasMessage, send, setName, setSerializationHandle, toString
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getQueueName, toString
send
public void setQueueName(java.lang.String name)
protected void init()
@PostConstruct public void postConstruct()
public QueueEntry<E> receiveEntry(long expireTime, boolean isAutoAck)
receiveEntry
in interface MessageQueue<E>
public QueueEntry<E> receiveEntry(long expireTime, boolean isAutoAck, QueueEntrySelector selector) throws MessageException
MessageException
public void receive(long expireTime, boolean isAutoAck, QueueEntrySelector selector, MessageCallback callback) throws MessageException
MessageException
public void addMessageCallback(MessageCallback<E> callback, boolean isAutoAck)
addMessageCallback
in interface MessageQueue<E>
public void removeMessageCallback(MessageCallback<E> entryCallback)
removeMessageCallback
in interface MessageQueue<E>
public void acknowledge(java.lang.String msgId)
acknowledge
in interface MessageQueue<E>
acknowledge
in class AbstractDestination<E>
msgId
- message to acknowledgepublic void rollback(java.lang.String msgId)
rollback
in interface MessageQueue<E>
rollback
in class AbstractDestination<E>
public E receive(long expireTime, boolean isAutoAcknowledge) throws MessageException
receive
in interface MessageQueue<E>
MessageException
public E receive(long expireTime, boolean isAutoAcknowledge, QueueEntrySelector selector) throws MessageException
MessageException
public java.util.ArrayList<? extends QueueEntry<E>> getBrowserList()
public int size()
public java.util.Iterator<E> iterator()
public boolean offer(E message, long timeout, java.util.concurrent.TimeUnit unit)
offer
in interface java.util.concurrent.BlockingQueue<E>
public boolean offer(E message)
public E poll(long timeout, java.util.concurrent.TimeUnit unit)
poll
in interface java.util.concurrent.BlockingQueue<E>
public int remainingCapacity()
remainingCapacity
in interface java.util.concurrent.BlockingQueue<E>
public int drainTo(java.util.Collection<? super E> c)
drainTo
in interface java.util.concurrent.BlockingQueue<E>
public int drainTo(java.util.Collection<? super E> c, int max)
drainTo
in interface java.util.concurrent.BlockingQueue<E>
public int getConsumerCount()
public int getReceiverCount()
public int getQueueSize()
public long getListenerFailCountTotal()
public long getListenerFailLastTime()
public void addListenerException(java.lang.Exception e)
@PreDestroy public void close()
close
in class AbstractDestination<E>