1 8 9 package foxtrot; 10 11 import foxtrot.workers.MultiWorkerThread; 12 13 29 public class ConcurrentWorker extends AbstractSyncWorker 30 { 31 private static ConcurrentWorker instance = new ConcurrentWorker(); 32 33 36 private ConcurrentWorker() 37 { 38 } 39 40 43 public static WorkerThread getWorkerThread() 44 { 45 return instance.workerThread(); 46 } 47 48 51 public static void setWorkerThread(WorkerThread workerThread) 52 { 53 instance.workerThread(workerThread); 54 } 55 56 WorkerThread createDefaultWorkerThread() 57 { 58 return new MultiWorkerThread(); 59 } 60 61 64 public static EventPump getEventPump() 65 { 66 return instance.eventPump(); 67 } 68 69 72 public static void setEventPump(EventPump eventPump) 73 { 74 instance.eventPump(eventPump); 75 } 76 77 81 public static Object post(Task task) throws Exception 82 { 83 return instance.post(task, getWorkerThread(), getEventPump()); 84 } 85 86 90 public static Object post(Job job) throws Exception 91 { 92 return instance.post(job, getWorkerThread(), getEventPump()); 93 } 94 } 95 | Popular Tags |