public abstract class AbstractMessageReceiver<T> extends java.lang.Object implements MessageReceiver<T>
Constructor and Description |
---|
AbstractMessageReceiver() |
Modifier and Type | Method and Description |
---|---|
void |
accepted(long mid)
Accept the last message.
|
boolean |
add(T e) |
boolean |
addAll(java.util.Collection<? extends T> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
int |
drainTo(java.util.Collection<? super T> c) |
int |
drainTo(java.util.Collection<? super T> c,
int maxElements) |
T |
element() |
long |
getLastMessageId()
Returns the last message id for client ack.
|
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
void |
modified(long mid,
boolean isFailed,
boolean isUndeliverableHere)
Returns the message as modified.
|
boolean |
offer(T e) |
boolean |
offer(T e,
long timeout,
java.util.concurrent.TimeUnit unit) |
protected void |
onBuild() |
T |
peek() |
T |
poll() |
T |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
protected abstract T |
pollMicros(long timeoutMicros)
Polls the queue with a timeout.
|
void |
put(T e) |
void |
rejected(long mid,
java.lang.String errorMessage)
Reject the last message.
|
void |
released(long mid)
Release the last message.
|
int |
remainingCapacity() |
T |
remove() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
T |
take() |
java.lang.Object[] |
toArray() |
<X> X[] |
toArray(X[] a) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected abstract T pollMicros(long timeoutMicros)
protected void onBuild()
public boolean isEmpty()
isEmpty
in interface java.util.Collection<T>
public int size()
size
in interface java.util.Collection<T>
public T poll(long timeout, java.util.concurrent.TimeUnit unit)
poll
in interface java.util.concurrent.BlockingQueue<T>
public T take() throws java.lang.InterruptedException
take
in interface java.util.concurrent.BlockingQueue<T>
java.lang.InterruptedException
public long getLastMessageId()
MessageReceiver
getLastMessageId
in interface MessageReceiver<T>
public void accepted(long mid)
MessageReceiver
accepted
in interface MessageReceiver<T>
public void rejected(long mid, java.lang.String errorMessage)
MessageReceiver
rejected
in interface MessageReceiver<T>
public void released(long mid)
MessageReceiver
released
in interface MessageReceiver<T>
public void modified(long mid, boolean isFailed, boolean isUndeliverableHere)
MessageReceiver
modified
in interface MessageReceiver<T>
public boolean remove(java.lang.Object o)
public boolean addAll(java.util.Collection<? extends T> c)
addAll
in interface java.util.Collection<T>
public void clear()
clear
in interface java.util.Collection<T>
public void put(T e) throws java.lang.InterruptedException
put
in interface java.util.concurrent.BlockingQueue<T>
java.lang.InterruptedException
public int remainingCapacity()
remainingCapacity
in interface java.util.concurrent.BlockingQueue<T>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<T>
public java.util.Iterator<T> iterator()
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<T>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<T>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<T>
public <X> X[] toArray(X[] a)
toArray
in interface java.util.Collection<T>
public boolean add(T e)
public boolean contains(java.lang.Object o)
public int drainTo(java.util.Collection<? super T> c)
drainTo
in interface java.util.concurrent.BlockingQueue<T>
public int drainTo(java.util.Collection<? super T> c, int maxElements)
drainTo
in interface java.util.concurrent.BlockingQueue<T>
public boolean offer(T e)
public boolean offer(T e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
offer
in interface java.util.concurrent.BlockingQueue<T>
java.lang.InterruptedException
public java.lang.String toString()
toString
in class java.lang.Object