Mercurial > hg > Database > Alice
comparison src/test/java/alice/daemon/ReceiveInteger.java @ 508:b7d02ea79850 dispose
change multicast Data Segment API
author | sugi |
---|---|
date | Sun, 04 Jan 2015 13:51:01 +0900 |
parents | |
children | 15eeb439830c |
comparison
equal
deleted
inserted
replaced
507:28627bb3eeda | 508:b7d02ea79850 |
---|---|
1 package alice.daemon; | |
2 | |
3 import alice.codesegment.CodeSegment; | |
4 import alice.datasegment.CommandType; | |
5 import alice.datasegment.Receiver; | |
6 | |
7 public class ReceiveInteger extends CodeSegment{ | |
8 | |
9 public Receiver num = ids.create(CommandType.TAKE); | |
10 | |
11 @Override | |
12 public void run() { | |
13 int num = this.num.asInteger(); | |
14 System.out.println("[CodeSegment] "+num); | |
15 | |
16 if (num==10) { | |
17 ods.put("multicast1", "str", "finish"); | |
18 try { | |
19 synchronized (this) { | |
20 wait(2000); | |
21 } | |
22 } catch (InterruptedException e) { | |
23 // TODO Auto-generated catch block | |
24 e.printStackTrace(); | |
25 } | |
26 System.exit(0); | |
27 } | |
28 ReceiveInteger cs = new ReceiveInteger(); | |
29 cs.num.setKey("num"); | |
30 | |
31 } | |
32 | |
33 } |