Updated Branches: refs/heads/master bb4061261 -> c80432fa9
CAMEL-7113: Ignored InterruptedException in IdGenerator Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c80432fa Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c80432fa Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c80432fa Branch: refs/heads/master Commit: c80432fa9803103e3227294787933e8397da9023 Parents: bb40612 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Jan 8 13:35:59 2014 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Jan 8 13:35:59 2014 +0100 ---------------------------------------------------------------------- .../java/org/apache/camel/impl/ActiveMQUuidGenerator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/c80432fa/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java b/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java index 16ef3d6..4ba7849 100644 --- a/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java +++ b/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java @@ -70,11 +70,15 @@ public class ActiveMQUuidGenerator implements UuidGenerator { ss = new ServerSocket(idGeneratorPort); stub = "-" + ss.getLocalPort() + "-" + System.currentTimeMillis() + "-"; Thread.sleep(100); - } catch (Exception ioe) { + } catch (Exception e) { if (LOG.isTraceEnabled()) { - LOG.trace("Cannot generate unique stub by using DNS and binding to local port: " + idGeneratorPort, ioe); + LOG.trace("Cannot generate unique stub by using DNS and binding to local port: " + idGeneratorPort, e); } else { - LOG.warn("Cannot generate unique stub by using DNS and binding to local port: " + idGeneratorPort + " due " + ioe.getMessage()); + LOG.warn("Cannot generate unique stub by using DNS and binding to local port: " + idGeneratorPort + " due " + e.getMessage()); + } + // Restore interrupted state so higher level code can deal with it. + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); } } finally { // some environments, such as a PaaS may not allow us to create the ServerSocket