@Override public MessageDispatch dequeueNoWait() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }
@Override public MessageDispatch peek() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return getFirst(); } }
@Override public MessageDispatch dequeue(long timeout) throws InterruptedException { synchronized (mutex) { // Wait until the consumer is ready to deliver messages. while (timeout != 0 && !closed && (isEmpty() || !running)) { if (timeout == -1) { mutex.wait(); } else { mutex.wait(timeout); break; } } if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }
@Override public MessageDispatch peek() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return getFirst(); } }
@Override public MessageDispatch peek() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return getFirst(); } }
@Override public MessageDispatch dequeue(long timeout) throws InterruptedException { synchronized (mutex) { // Wait until the consumer is ready to deliver messages. while (timeout != 0 && !closed && (isEmpty() || !running)) { if (timeout == -1) { mutex.wait(); } else { mutex.wait(timeout); break; } } if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }
@Override public MessageDispatch dequeueNoWait() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }
@Override public MessageDispatch dequeueNoWait() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }
@Override public MessageDispatch peek() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return getFirst(); } }
@Override public MessageDispatch dequeue(long timeout) throws InterruptedException { synchronized (mutex) { // Wait until the consumer is ready to deliver messages. while (timeout != 0 && !closed && (isEmpty() || !running)) { if (timeout == -1) { mutex.wait(); } else { mutex.wait(timeout); break; } } if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }
@Override public MessageDispatch dequeueNoWait() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }
@Override public MessageDispatch dequeue(long timeout) throws InterruptedException { synchronized (mutex) { // Wait until the consumer is ready to deliver messages. while (timeout != 0 && !closed && (isEmpty() || !running)) { if (timeout == -1) { mutex.wait(); } else { mutex.wait(timeout); break; } } if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }
public MessageDispatch dequeue(long timeout) throws InterruptedException { synchronized (mutex) { // Wait until the consumer is ready to deliver messages. while (timeout != 0 && !closed && (isEmpty() || !running)) { if (timeout == -1) { mutex.wait(); } else { mutex.wait(timeout); break; } } if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }
public MessageDispatch peek() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return getFirst(); } }
public MessageDispatch dequeueNoWait() { synchronized (mutex) { if (closed || !running || isEmpty()) { return null; } return removeFirst(); } }