camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: Add thread name to hangup so we dont use anonymous thread name.
Date Wed, 05 Jul 2017 14:10:35 GMT
Repository: camel
Updated Branches:
  refs/heads/master dd702e612 -> aa50215bb


Add thread name to hangup so we dont use anonymous thread name.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/aa50215b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/aa50215b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/aa50215b

Branch: refs/heads/master
Commit: aa50215bb818d097aa29359ad44f3cd8d62a7126
Parents: dd702e6
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Jul 5 11:49:03 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Jul 5 16:10:24 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/main/MainSupport.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/aa50215b/camel-core/src/main/java/org/apache/camel/main/MainSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/main/MainSupport.java b/camel-core/src/main/java/org/apache/camel/main/MainSupport.java
index 50c59ad..5456326 100644
--- a/camel-core/src/main/java/org/apache/camel/main/MainSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/main/MainSupport.java
@@ -38,6 +38,7 @@ import org.apache.camel.spi.ModelJAXBContextFactory;
 import org.apache.camel.spi.ReloadStrategy;
 import org.apache.camel.support.ServiceSupport;
 import org.apache.camel.util.ServiceHelper;
+import org.apache.camel.util.concurrent.ThreadHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -241,7 +242,11 @@ public abstract class MainSupport extends ServiceSupport {
 
     private void internalBeforeStart() {
         if (hangupInterceptorEnabled) {
-            Runtime.getRuntime().addShutdownHook(new HangupInterceptor(this));
+            String threadName = ThreadHelper.resolveThreadName(null, "CamelHangupInterceptor");
+
+            Thread task = new HangupInterceptor(this);
+            task.setName(threadName);
+            Runtime.getRuntime().addShutdownHook(task);
         }
     }
 


Mime
View raw message