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

All Superinterfaces:
Source<T>
All Known Subinterfaces:
MessageChannel
All Known Implementing Classes:
AbstractMessageChannel, DefaultErrorChannel, DirectChannel, PriorityChannel, QueueChannel, RendezvousChannel, RequestReplyTemplate.ReplyHandlingChannelAdapter, ThreadLocalChannel

public interface BlockingSource<T>
extends Source<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 Source<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