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 ScheduledExecutorServiceImpl implements Executor { 39 private static final L10N L = new L10N(ScheduledExecutorServiceImpl.class); 40 private static final Logger log 41 = Logger.getLogger(ScheduledExecutorServiceImpl.class.getName()); 42 43 private static ScheduledExecutorServiceImpl _service 44 = new ScheduledExecutorServiceImpl(); 45 46 private ThreadPool _threadPool = ThreadPool.getThreadPool(); 47 48 private ScheduledExecutorServiceImpl() 49 { 50 } 51 52 public static ScheduledExecutorServiceImpl create() 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 | Popular Tags |