1 29 30 package com.caucho.util; 31 32 import java.util.concurrent.Executor ; 33 import java.util.logging.Logger ; 34 35 38 public class ResinThreadPoolExecutor implements Executor { 39 private static final L10N L = new L10N(ResinThreadPoolExecutor.class); 40 private static final Logger log 41 = Logger.getLogger(ResinThreadPoolExecutor.class.getName()); 42 43 private static ResinThreadPoolExecutor _service 44 = new ResinThreadPoolExecutor(); 45 46 private ThreadPool _threadPool = ThreadPool.getThreadPool(); 47 48 private ResinThreadPoolExecutor() 49 { 50 } 51 52 public static ResinThreadPoolExecutor getThreadPool() 53 { 54 return _service; 55 } 56 57 61 public void execute(Runnable task) 62 { 63 if (task == null) 64 throw new NullPointerException (); 65 66 _threadPool.schedule(task); 67 } 68 69 72 public void stopEnvironment(ClassLoader env) 73 { 74 _threadPool.closeEnvironment(env); 75 } 76 77 public String toString() 78 { 79 return "ResinThreadPoolExecutor[]"; 80 } 81 } 82 | Popular Tags |