public class ClusterQueueImpl<E extends java.io.Serializable> extends AbstractQueue<E>
Constructor and Description |
---|
ClusterQueueImpl() |
ClusterQueueImpl(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
acknowledge(java.lang.String msgId)
Acknowledge receipt of the message.
|
void |
addMessageCallback(MessageCallback<E> callback,
boolean isAutoAck)
Adds the callback to the listening list.
|
void |
close() |
int |
getConsumerCount()
Returns the number of active message consumers
|
protected TriadOwner |
getQueueOwner(byte[] queueHash) |
int |
getQueueSize()
Returns the queue size
|
boolean |
hasMessage()
Returns true if the queue has at least one message available
|
boolean |
hasMessage(java.lang.String subscription) |
void |
init() |
boolean |
isBackup()
Set true if messages should be backed up.
|
E |
receive(long expireTime,
boolean isAutoAck)
Receives a message, blocking until expireTime if no message is
available.
|
E |
receive(long expireTime,
boolean isAutoAck,
QueueEntrySelector selector) |
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) |
void |
removeMessageCallback(MessageCallback<E> callback)
Removes the callback from the listening list.
|
void |
rollback(java.lang.String msgId)
Rollback the message read.
|
void |
send(java.lang.String msgId,
E payload,
int priority,
long expires,
java.lang.String publisherId)
Sends a message to the queue
|
void |
setBackup(boolean isBackup)
Set true if messages should be backed up.
|
void |
setCluster(java.lang.String cluster) |
addListenerException, drainTo, drainTo, getBrowserList, getListenerFailCountTotal, getListenerFailLastTime, getReceiverCount, iterator, offer, offer, peek, poll, poll, postConstruct, put, 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, wait, wait, wait
getQueueName, toString
public ClusterQueueImpl()
public ClusterQueueImpl(java.lang.String name)
@Configurable public void setBackup(boolean isBackup)
public boolean isBackup()
public void setCluster(java.lang.String cluster)
public int getQueueSize()
AbstractQueue
getQueueSize
in class AbstractQueue<E extends java.io.Serializable>
public int getConsumerCount()
AbstractQueue
getConsumerCount
in class AbstractQueue<E extends java.io.Serializable>
@PostConstruct public void init()
init
in class AbstractQueue<E extends java.io.Serializable>
protected TriadOwner getQueueOwner(byte[] queueHash)
public void send(java.lang.String msgId, E payload, int priority, long expires, java.lang.String publisherId)
AbstractDestination
send
in interface MessageQueue<E extends java.io.Serializable>
send
in class AbstractDestination<E extends java.io.Serializable>
public E receive(long expireTime, boolean isAutoAck)
receive
in interface MessageQueue<E extends java.io.Serializable>
receive
in class AbstractQueue<E extends java.io.Serializable>
public E receive(long expireTime, boolean isAutoAck, QueueEntrySelector selector)
receive
in class AbstractQueue<E extends java.io.Serializable>
public QueueEntry<E> receiveEntry(long expireTime, boolean isAutoAck) throws MessageException
receiveEntry
in interface MessageQueue<E extends java.io.Serializable>
receiveEntry
in class AbstractQueue<E extends java.io.Serializable>
MessageException
public QueueEntry<E> receiveEntry(long expireTime, boolean isAutoAck, QueueEntrySelector selector) throws MessageException
receiveEntry
in class AbstractQueue<E extends java.io.Serializable>
MessageException
public void addMessageCallback(MessageCallback<E> callback, boolean isAutoAck) throws MessageException
AbstractQueue
addMessageCallback
in interface MessageQueue<E extends java.io.Serializable>
addMessageCallback
in class AbstractQueue<E extends java.io.Serializable>
MessageException
public void removeMessageCallback(MessageCallback<E> callback) throws MessageException
AbstractQueue
removeMessageCallback
in interface MessageQueue<E extends java.io.Serializable>
removeMessageCallback
in class AbstractQueue<E extends java.io.Serializable>
MessageException
public void rollback(java.lang.String msgId)
AbstractQueue
rollback
in interface MessageQueue<E extends java.io.Serializable>
rollback
in class AbstractQueue<E extends java.io.Serializable>
public void acknowledge(java.lang.String msgId)
AbstractQueue
acknowledge
in interface MessageQueue<E extends java.io.Serializable>
acknowledge
in class AbstractQueue<E extends java.io.Serializable>
msgId
- message to acknowledgepublic boolean hasMessage()
AbstractDestination
hasMessage
in class AbstractDestination<E extends java.io.Serializable>
public boolean hasMessage(java.lang.String subscription)
@PreDestroy public void close()
close
in class AbstractQueue<E extends java.io.Serializable>