1 package psl;
2
3 import ensure.Ensure;
4
5
6
7
8
9
10
11
12 class ExecutorRunnable implements Runnable {
13
14
15
16 private Runnable m_inner;
17
18
19
20
21
22 public ExecutorRunnable(Runnable r) {
23 Ensure.not_null(r, "r == null");
24
25 m_inner = r;
26 }
27
28 @Override
29 public void run() {
30 Ensure.is_instance(Thread.currentThread(), DispatcherThread.class,
31 "!(Thread.currentThread() instanceof DispatcherThread)");
32 ((DispatcherThread) Thread.currentThread()).dispatch(m_inner);
33 }
34 }