/** * Polls for and returns the next message, or <tt>null</tt> if there isn't * a message immediately available. This method provides significantly different * functionalty than the {@link #nextMessage()} method since it's non-blocking. * In other words, the method call will always return immediately, whereas the * nextMessage method will return only when a message is available (or after * a specific timeout). * * @return the next message if one is immediately available and * <tt>null</tt> otherwise. */ public Message pollMessage() { return (Message) messageCollector.pollResult(); }
/** * Polls for and returns the next message, or <tt>null</tt> if there isn't * a message immediately available. This method provides significantly different * functionalty than the {@link #nextMessage()} method since it's non-blocking. * In other words, the method call will always return immediately, whereas the * nextMessage method will return only when a message is available (or after * a specific timeout). * * @return the next message if one is immediately available and * <tt>null</tt> otherwise. */ public Message pollMessage() { return (Message) messageCollector.pollResult(); }
/** * Polls for and returns the next message, or <tt>null</tt> if there isn't * a message immediately available. This method provides significantly different * functionalty than the {@link #nextMessage()} method since it's non-blocking. * In other words, the method call will always return immediately, whereas the * nextMessage method will return only when a message is available (or after * a specific timeout). * * @return the next message if one is immediately available and * <tt>null</tt> otherwise. */ public Message pollMessage() { return (Message) messageCollector.pollResult(); }