package com.wangyin.ak47.core.event;


import java.util.concurrent.Executor;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;


/**
 * 
 * @author hannyu
 *
 */
public class SingleThreadEventExecutor extends ThreadPoolExecutor implements Executor {

    public SingleThreadEventExecutor(int corePoolSize, int maximumPoolSize) {
        super(corePoolSize, maximumPoolSize, 30, TimeUnit.SECONDS, 
                new SynchronousQueue<Runnable>(), 
                new Ak47ThreadFactory());
    }

    

}

@@ -325,17 +325,976 @@
 cutor %7B%0A
+    %0A    // How many CPU ?%0A    private static final int CPU_NUM = Runtime.getRuntime().availableProcessors();%0A    %0A    public static final int DEFAULT_CORE_POOL_SIZE = CPU_NUM;%0A    public static final int DEFAULT_MAX_POOL_SIZE = CPU_NUM * 4;%0A    %0A    private static final int KEEP_ALIVE_TIME = 30;%0A    %0A    /**%0A     * Creates a new ThreadPoolExecutor with the default pool size.%0A     */%0A    public SingleThreadEventExecutor()%7B%0A        this(DEFAULT_CORE_POOL_SIZE, DEFAULT_MAX_POOL_SIZE);%0A    %7D%0A    %0A    /**%0A     * Creates a new ThreadPoolExecutor with the given initial parameters and %0A     * default rejected execution handler.%0A     * %0A     * @param corePoolSize          the number of threads to keep in the pool, %0A     *                              even if they are idle, unless allowCoreThreadTimeOut is set%0A     * @param maximumPoolSize       maximumPoolSize the maximum number of threads to allow in the%0A     *                              pool%0A     */
 %0A
-
     publ
@@ -1408,18 +1408,31 @@
 olSize, 
-30
+KEEP_ALIVE_TIME
 , TimeUn

add no-argument constructor