Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
866 bytes
|
Line | |
---|
1 | package com.framsticks.util.dispatching; |
---|
2 | |
---|
3 | |
---|
4 | /** |
---|
5 | * @author Piotr Sniegowski |
---|
6 | */ |
---|
7 | public class AtOnceDispatcher<C> extends AbstractJoinable implements Dispatcher<C> { |
---|
8 | |
---|
9 | @SuppressWarnings("rawtypes") |
---|
10 | protected static final AtOnceDispatcher instance = new AtOnceDispatcher(); |
---|
11 | |
---|
12 | @SuppressWarnings("unchecked") |
---|
13 | public static <C> Dispatcher<C> getInstance() { |
---|
14 | return (Dispatcher<C>) instance; |
---|
15 | } |
---|
16 | |
---|
17 | @Override |
---|
18 | public final boolean isActive() { |
---|
19 | return true; |
---|
20 | } |
---|
21 | |
---|
22 | @Override |
---|
23 | public final void dispatch(RunAt<? extends C> runnable) { |
---|
24 | runnable.runAt(); |
---|
25 | } |
---|
26 | |
---|
27 | @Override |
---|
28 | public String getName() { |
---|
29 | return "atonce"; |
---|
30 | } |
---|
31 | |
---|
32 | @Override |
---|
33 | protected void joinableStart() { |
---|
34 | |
---|
35 | } |
---|
36 | |
---|
37 | @Override |
---|
38 | protected void joinableInterrupt() { |
---|
39 | finishJoinable(); |
---|
40 | } |
---|
41 | |
---|
42 | @Override |
---|
43 | protected void joinableFinish() { |
---|
44 | |
---|
45 | } |
---|
46 | |
---|
47 | @Override |
---|
48 | protected void joinableJoin() throws InterruptedException { |
---|
49 | |
---|
50 | } |
---|
51 | |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.