Merge branch 'master' of git.springsource.org:spring-integration/spring-integration
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user