@Test public void testEnqueueFirst() { JmsInboundMessageDispatch message1 = createEnvelope(); JmsInboundMessageDispatch message2 = createEnvelope(); JmsInboundMessageDispatch message3 = createEnvelope(); queue.enqueueFirst(message1); queue.enqueueFirst(message2); queue.enqueueFirst(message3); assertSame(message3, queue.dequeueNoWait()); assertSame(message2, queue.dequeueNoWait()); assertSame(message1, queue.dequeueNoWait()); }
@Override public void enqueueFirst(JmsInboundMessageDispatch envelope) { lock.lock(); try { queue.addFirst(envelope); condition.signal(); } finally { lock.unlock(); } }
FifoMessageQueue implements MessageQueue { @Override public void enqueueFirst(JmsInboundMessageDispatch envelope) { lock.lock(); try { queue.addFirst(envelope); condition.signal(); } finally { lock.unlock(); } } }
FifoMessageQueue implements MessageQueue { @Override public void enqueueFirst(JmsInboundMessageDispatch envelope) { lock.lock(); try { queue.addFirst(envelope); condition.signal(); } finally { lock.unlock(); } } FifoMessageQueue(int prefetchSize); }
FifoMessageQueue implements MessageQueue { @Override public void enqueueFirst(JmsInboundMessageDispatch envelope) { lock.lock(); try { queue.addFirst(envelope); condition.signal(); } finally { lock.unlock(); } } FifoMessageQueue(int prefetchSize); @Override void enqueueFirst(JmsInboundMessageDispatch envelope); @Override void enqueue(JmsInboundMessageDispatch envelope); @Override JmsInboundMessageDispatch dequeue(long timeout); @Override final JmsInboundMessageDispatch dequeueNoWait(); @Override final void start(); @Override final void stop(); @Override final void close(); @Override final boolean isRunning(); @Override final boolean isClosed(); @Override boolean isEmpty(); @Override int size(); @Override void clear(); @Override String toString(); }
FifoMessageQueue implements MessageQueue { @Override public void enqueueFirst(JmsInboundMessageDispatch envelope) { lock.lock(); try { queue.addFirst(envelope); condition.signal(); } finally { lock.unlock(); } } FifoMessageQueue(int prefetchSize); @Override void enqueueFirst(JmsInboundMessageDispatch envelope); @Override void enqueue(JmsInboundMessageDispatch envelope); @Override JmsInboundMessageDispatch dequeue(long timeout); @Override final JmsInboundMessageDispatch dequeueNoWait(); @Override final void start(); @Override final void stop(); @Override final void close(); @Override final boolean isRunning(); @Override final boolean isClosed(); @Override boolean isEmpty(); @Override int size(); @Override void clear(); @Override String toString();  }