code: public static ExecutorService createFixedTimeoutExecutorService(
          int poolSize, long keepAliveTime, TimeUnit timeUnit)
      {
          ThreadPoolExecutor e = 
              new ThreadPoolExecutor(poolSize, poolSize,
                  keepAliveTime, timeUnit, new LinkedBlockingQueue<Runnable>());
          e.allowCoreThreadTimeOut(true);
          return e;
      }
docs: Creates an executor service with a fixed pool size, that will time
  out after a certain period of inactivity.
  
  @param poolSize The core- and maximum pool size
  @param keepAliveTime The keep alive time
  @param timeUnit The time unit
  @return The executor service