1 22 package org.jboss.mx.util; 23 24 import java.util.Iterator ; 25 import java.util.TreeSet ; 26 27 import org.jboss.util.threadpool.ThreadPool; 28 import org.jboss.util.timeout.TimeoutFactory; 29 import org.jboss.util.timeout.Timeout; 30 31 43 public class RunnableScheduler 44 { 45 46 48 51 private TimeoutFactory factory; 52 53 56 public RunnableScheduler() 57 { 58 this.factory = new TimeoutFactory(); 59 } 60 61 64 public RunnableScheduler(ThreadPool threadPool) 65 { 66 this.factory = new TimeoutFactory(threadPool); 67 } 68 69 72 public void start() 73 { 74 } 75 76 79 public synchronized void stop() 80 { 81 factory.cancel(); 82 } 83 84 87 public void run() 88 { 89 } 90 91 93 95 97 99 101 106 Timeout add(SchedulableRunnable runnable) 107 { 108 return factory.schedule(runnable.getNextRun(), runnable); 109 } 110 111 113 } 115 116 | Popular Tags |