@Test public void testReceiveNoWait() throws JMSException { JmsPoolConnection connection = (JmsPoolConnection) cf.createQueueConnection(); Session session = connection.createSession(); Queue queue = session.createTemporaryQueue(); MessageConsumer consumer = session.createConsumer(queue, "Color = Red"); assertNull(consumer.receiveNoWait()); consumer.close(); try { consumer.receiveNoWait(); fail("Should not be able to interact with closed consumer"); } catch (IllegalStateException ise) {} }
@Override public Message receiveNoWait() throws JMSException { checkClosed(); return messageConsumer.receiveNoWait(); }
JmsPoolMessageConsumer implements MessageConsumer, AutoCloseable { @Override public Message receiveNoWait() throws JMSException { checkClosed(); return messageConsumer.receiveNoWait(); } }
JmsPoolMessageConsumer implements MessageConsumer, AutoCloseable { @Override public Message receiveNoWait() throws JMSException { checkClosed(); return messageConsumer.receiveNoWait(); } JmsPoolMessageConsumer(JmsPoolSession session, MessageConsumer messageConsumer); }
JmsPoolMessageConsumer implements MessageConsumer, AutoCloseable { @Override public Message receiveNoWait() throws JMSException { checkClosed(); return messageConsumer.receiveNoWait(); } JmsPoolMessageConsumer(JmsPoolSession session, MessageConsumer messageConsumer); @Override void close(); @Override MessageListener getMessageListener(); @Override String getMessageSelector(); @Override Message receive(); @Override Message receive(long timeout); @Override Message receiveNoWait(); @Override void setMessageListener(MessageListener listener); @Override String toString(); MessageConsumer getMessageConsumer(); }
JmsPoolMessageConsumer implements MessageConsumer, AutoCloseable { @Override public Message receiveNoWait() throws JMSException { checkClosed(); return messageConsumer.receiveNoWait(); } JmsPoolMessageConsumer(JmsPoolSession session, MessageConsumer messageConsumer); @Override void close(); @Override MessageListener getMessageListener(); @Override String getMessageSelector(); @Override Message receive(); @Override Message receive(long timeout); @Override Message receiveNoWait(); @Override void setMessageListener(MessageListener listener); @Override String toString(); MessageConsumer getMessageConsumer();  }