/**
* Send messages to the client.
*/
private void dispatch() {
final Condition timeout = TimedCondition.after(30 * 1000);
Condition done = new Condition() {
public boolean get() {
return _stop.get() || timeout.get();
}
};
_log.debug("dispatch");
int sent = 0;
while (sent < MAX_MESSAGES && !done.get()) {
ConsumerEndpoint consumer;
synchronized (_pending) {
if (!_pending.isEmpty()) {
consumer = (ConsumerEndpoint) _pending.removeFirst();
} else {