org.springframework.integration.message
Interface BlockingSource<T>

All Superinterfaces:
MessageSource<T>, PollableSource<T>
All Known Subinterfaces:
PollableChannel
All Known Implementing Classes:
AbstractPollableChannel, DefaultErrorChannel, MessageExchangeTemplate.TemporaryReturnAddress, PriorityChannel, QueueChannel, RendezvousChannel, ThreadLocalChannel

public interface BlockingSource<T>
extends PollableSource<T>

Extends PollableSource and provides a timeout-aware receive method.

Author:
Mark Fisher

Method Summary
 Message<T> receive()
          Receive a message, blocking indefinitely if necessary.
 Message<T> receive(long timeout)
          Receive a message, blocking until either a message is available or the specified timeout period elapses.
 

Method Detail

receive

Message<T> receive()
Receive a message, blocking indefinitely if necessary.

Specified by:
receive in interface PollableSource<T>
Returns:
the next available Message or null if interrupted

receive

Message<T> receive(long timeout)
Receive a message, blocking until either a message is available or the specified timeout period elapses.

Parameters:
timeout - the timeout in milliseconds
Returns:
the next available Message or null if the specified timeout period elapses or the message reception is interrupted