Updated Branches: refs/heads/camel-2.12.x c8442cf66 -> 6738c8ad1
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/6738c8ad Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6738c8ad Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6738c8ad Branch: refs/heads/camel-2.12.x Commit: 6738c8ad106c239ef178aab3d6d83fb03fa4b6e8 Parents: c8442cf 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:45:49 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/6738c8ad/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