01: package org.objectweb.celtix.workqueue;
02:
03: public interface WorkQueueManager {
04:
05: enum ThreadingModel {
06: SINGLE_THREADED, MULTI_THREADED
07: };
08:
09: /**
10: * Get the manager's work queue.
11: * @return AutomaticWorkQueue
12: */
13: AutomaticWorkQueue getAutomaticWorkQueue();
14:
15: /**
16: * Get the threading model.
17: * @return ThreadingModel - either <code>SINGLE_THREADED</code>
18: * or <code>MULTI_THREADED</code>.
19: */
20: ThreadingModel getThreadingModel();
21:
22: /**
23: * Set the threading model.
24: * @param model either <code>SINGLE_THREADED</code>
25: * or <code>MULTI_THREADED</code>.
26: */
27: void setThreadingModel(ThreadingModel model);
28:
29: /**
30: * Shuts down the manager's work queue. If
31: * <code>processRemainingTasks</code> is true, waits for the work queue to
32: * shutdown before returning.
33: * @param processRemainingTasks - whether or not to wait for completion
34: */
35: void shutdown(boolean processRemainingTasks);
36:
37: /**
38: * Only returns after workqueue has been shutdown.
39: *
40: */
41: void run();
42: }
|