01: package dalma;
02:
03: /**
04: * An object that executes the submitted {@link Runnable}s.
05: *
06: * This interface allows the engine to be used with JDK 5.0's concurrency utilities,
07: * without introducing a hard-coded dependency.
08: *
09: * @author Kohsuke Kawaguchi
10: */
11: public interface Executor {
12: void execute(Runnable command);
13:
14: /**
15: * Shuts down the executor.
16: *
17: * This method blocks until all the scheduled {@link Runnable}s are completed,
18: * or the timeout occurs.
19: *
20: * @param timeout
21: * Number of milliseconds to wait. 0 for no timeout.
22: */
23: void stop(long timeout) throws InterruptedException;
24: }
|