Code example for ThreadFactory

Methods: newThread

  public void execute(Runnable task)
    Thread thread = _threadFactory.newThread(task);
   * Executes the callable in a separate thread and return the future to get the result. Note 
   * that this implementation is not efficient and should be used very carefully. 
   * @param callable 
   * @return the future to get the result. 
  public static <V> Future<V> execute(Callable<V> callable)
    FutureTask<V> futureTask = new FutureTask<V>(callable);