Merge branch 'master' of git.springsource.org:spring-integration/spring-integration

This commit is contained in:
Oleg Zhurakousky
2010-09-24 15:41:37 -04:00
3 changed files with 20 additions and 6 deletions

View File

@@ -171,8 +171,12 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler
* @throws Exception
*/
public Message<?> getReply() throws Exception {
if (!this.latch.await(replyTimeout, TimeUnit.MILLISECONDS)) {
return null;
try {
if (!this.latch.await(replyTimeout, TimeUnit.MILLISECONDS)) {
return null;
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
return this.reply;
}

View File

@@ -65,7 +65,11 @@ public class TcpNioClientConnectionFactory extends
public TcpConnection getConnection() throws Exception {
int n = 0;
while (this.selector == null) {
Thread.sleep(100);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
if (n++ > 600) {
throw new Exception("Factory failed to start");
}

View File

@@ -198,7 +198,9 @@ public class UnicastSendingMessageHandler extends
this.taskExecutor.execute(this);
try {
ackLatch.await(10000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) { }
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
}
@@ -218,8 +220,12 @@ public class UnicastSendingMessageHandler extends
this.send(packet);
logger.debug("Sent packet for message " + message);
if (this.waitForAck) {
if (!countdownLatch.await(this.ackTimeout, TimeUnit.MILLISECONDS)) {
throw new MessagingException(message, "Failed to receive UDP Ack in " + ackTimeout + " millis");
try {
if (!countdownLatch.await(this.ackTimeout, TimeUnit.MILLISECONDS)) {
throw new MessagingException(message, "Failed to receive UDP Ack in " + ackTimeout + " millis");
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}