package com.wangyin.ak47.core.event;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;


public class Ak47ThreadFactory implements ThreadFactory {
    
    private static final AtomicInteger POOL_NUM = new AtomicInteger(1);
    private AtomicInteger threadNum = new AtomicInteger(1);
    private String prefix;
    
    public Ak47ThreadFactory(){
        prefix = "ak47-thread-" + POOL_NUM.getAndIncrement() + "-";
    }
    
    @Override
    public Thread newThread(Runnable runnable){
        String name = prefix + threadNum.getAndIncrement();
        Thread thread = new Thread(runnable, name);
        return thread;
    }

}

@@ -185,24 +185,105 @@
 tory %7B%0A    %0A
+    private static final String THREAD_NAME_PREFIX_PREFIX = %22ak47-thread-%22;%0A    %0A
     private 
@@ -483,30 +483,41 @@
 refix = 
-%22ak47-thread-%22
+THREAD_NAME_PREFIX_PREFIX
  + POOL_

add THREAD_NAME_PREFIX_PREFIX