{
lock.wait(500);
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
}
continue;
}
Message msg = null;
try
{
msg = sourceConsumer.receive(1000);
if (msg instanceof HornetQMessage)
{
// We need to check the buffer mainly in the case of LargeMessages
// As we need to reconstruct the buffer before resending the message
((HornetQMessage) msg).checkBuffer();
}
}
catch (JMSException jmse)
{
if (JMSBridgeImpl.trace)
{
HornetQJMSServerLogger.LOGGER.trace(this + " exception while receiving a message", jmse);
}
}
if (msg == null)
{
try
{
lock.wait(500);
}
catch (InterruptedException e)
{
if (JMSBridgeImpl.trace)
{
HornetQJMSServerLogger.LOGGER.trace(this + " thread was interrupted");
}
throw new HornetQInterruptedException(e);
}
continue;
}
if (JMSBridgeImpl.trace)