01: package dalma.impl;
02:
03: import dalma.Condition;
04: import dalma.Conversation;
05:
06: /**
07: * {@link Condition} that waits for the completion of a {@link Conversation}.
08: *
09: * @author Kohsuke Kawaguchi
10: */
11: final class ConversationCondition extends Condition<Conversation> {
12:
13: private final ConversationImpl conv;
14:
15: ConversationCondition(ConversationImpl conv) {
16: this .conv = conv;
17: }
18:
19: public void onParked() {
20: conv.waitList.add(this );
21: }
22:
23: public void interrupt() {
24: conv.waitList.remove(this );
25: }
26:
27: public void onLoad() {
28: onParked();
29: }
30:
31: private static final long serialVersionUID = 1L;
32: }
|