@@ -0,0 +1,1616 @@
+/**%0A *  Copyright 2005-2015 Red Hat, Inc.%0A *%0A *  Red Hat licenses this file to you under the Apache License, version%0A *  2.0 (the %22License%22); you may not use this file except in compliance%0A *  with the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing, software%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or%0A *  implied.  See the License for the specific language governing%0A *  permissions and limitations under the License.%0A */%0Apackage io.fabric8.utils;%0A%0Aimport java.util.concurrent.atomic.AtomicInteger;%0A%0Apublic class NamedThreadFactory implements java.util.concurrent.ThreadFactory %7B%0A%0A    private static final AtomicInteger poolNumber = new AtomicInteger(1);%0A    private final ThreadGroup group;%0A    private final AtomicInteger threadNumber = new AtomicInteger(1);%0A    private final String namePrefix;%0A%0A    public NamedThreadFactory(String prefix) %7B%0A        SecurityManager s = System.getSecurityManager();%0A        group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();%0A        namePrefix = prefix + %22-%22 + poolNumber.getAndIncrement() + %22-thread-%22;%0A    %7D%0A%0A    public Thread newThread(Runnable r) %7B%0A        Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0);%0A        if (t.isDaemon())%0A            t.setDaemon(false);%0A        if (t.getPriority() != Thread.NORM_PRIORITY)%0A            t.setPriority(Thread.NORM_PRIORITY);%0A        return t;%0A    %7D%0A%0A%7D%0A

Use NamedThreadFactory in critical places