public abstract class AbstractMemoryQueue<E,QE extends QueueEntry<E>> extends AbstractQueue<E>
Constructor and Description |
---|
AbstractMemoryQueue() |
Modifier and Type | Method and Description |
---|---|
protected void |
acknowledge(QE entry) |
void |
acknowledge(java.lang.String msgId)
Acknowledges the receipt of a message
|
void |
addMessageCallback(MessageCallback<E> callback,
boolean isAutoAck)
Adds the callback to the listening list.
|
protected void |
addQueueEntry(QE entry,
long expires) |
protected void |
dispatchMessage() |
java.util.ArrayList<QE> |
getBrowserList() |
int |
getConsumerCount()
Returns the number of active message consumers
|
java.util.ArrayList<java.lang.String> |
getMessageIds() |
int |
getQueueSize()
Returns the queue size
|
int |
getQueueSizeMax() |
int |
getReceiverCount()
Returns the number of receivers.
|
boolean |
hasMessage()
Returns true if a message is available.
|
protected boolean |
listen(com.caucho.jms.queue.EntryCallback<E> callback) |
protected QE |
readEntry()
Returns the next entry from the queue
|
protected QE |
readEntry(QueueEntrySelector selector)
Returns the next entry from the queue
|
protected void |
readPayload(QE entry) |
void |
receive(long expireTime,
boolean isAutoAck,
QueueEntrySelector selector,
MessageCallback callback) |
QE |
receiveEntry(long expireTime,
boolean isAutoAck)
Primary message receiving, registers a callback for any new
message.
|
QE |
receiveEntry(long expireTime,
boolean isAutoAck,
QueueEntrySelector selector) |
protected QE |
removeEntry(java.lang.String msgId)
Removes message.
|
void |
removeMessageCallback(MessageCallback<E> callback)
Removes the callback from the listening list.
|
void |
rollback(java.lang.String msgId)
Rolls back the receipt of a message
|
void |
send(java.lang.String msgId,
E payload,
int priority,
long expireTime,
java.lang.String publisherId)
Sends a message to the queue
|
void |
setQueueSizeMax(int max) |
protected abstract QE |
writeEntry(java.lang.String msg,
E payload,
int priority,
long expires) |
addListenerException, close, drainTo, drainTo, getListenerFailCountTotal, getListenerFailLastTime, init, iterator, offer, offer, peek, poll, poll, postConstruct, put, receive, receive, remainingCapacity, setQueueName, size, take
generateMessageID, generateMessageID, getJMSDestination, getName, getQueueName, getTopicName, getUrl, setName, setSerializationHandle, toString
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getQueueName, toString
public void setQueueSizeMax(int max)
public int getQueueSizeMax()
public void send(java.lang.String msgId, E payload, int priority, long expireTime, java.lang.String publisherId) throws MessageException
send
in interface MessageQueue<E>
send
in class AbstractDestination<E>
MessageException
protected abstract QE writeEntry(java.lang.String msg, E payload, int priority, long expires)
protected void addQueueEntry(QE entry, long expires)
public QE receiveEntry(long expireTime, boolean isAutoAck) throws MessageException
receiveEntry
in interface MessageQueue<E>
receiveEntry
in class AbstractQueue<E>
MessageException
public QE receiveEntry(long expireTime, boolean isAutoAck, QueueEntrySelector selector) throws MessageException
receiveEntry
in class AbstractQueue<E>
MessageException
public void receive(long expireTime, boolean isAutoAck, QueueEntrySelector selector, MessageCallback callback) throws MessageException
receive
in class AbstractQueue<E>
MessageException
public void addMessageCallback(MessageCallback<E> callback, boolean isAutoAck)
AbstractQueue
addMessageCallback
in interface MessageQueue<E>
addMessageCallback
in class AbstractQueue<E>
public void removeMessageCallback(MessageCallback<E> callback)
AbstractQueue
removeMessageCallback
in interface MessageQueue<E>
removeMessageCallback
in class AbstractQueue<E>
protected void acknowledge(QE entry)
protected void readPayload(QE entry)
public void acknowledge(java.lang.String msgId)
acknowledge
in interface MessageQueue<E>
acknowledge
in class AbstractQueue<E>
msgId
- message to acknowledgeprotected boolean listen(com.caucho.jms.queue.EntryCallback<E> callback) throws MessageException
MessageException
protected void dispatchMessage()
public int getQueueSize()
getQueueSize
in class AbstractQueue<E>
public boolean hasMessage()
hasMessage
in class AbstractDestination<E>
public int getConsumerCount()
AbstractQueue
getConsumerCount
in class AbstractQueue<E>
public int getReceiverCount()
AbstractQueue
getReceiverCount
in class AbstractQueue<E>
protected QE readEntry()
protected QE readEntry(QueueEntrySelector selector)
public java.util.ArrayList<QE> getBrowserList()
getBrowserList
in class AbstractQueue<E>
selector
- protected QE removeEntry(java.lang.String msgId)
public void rollback(java.lang.String msgId)
rollback
in interface MessageQueue<E>
rollback
in class AbstractQueue<E>
public java.util.ArrayList<java.lang.String> getMessageIds()