comparison src/alice/test/topology/aquarium/fx/Share.java @ 1:b997f2ce1a04

add Controller Class
author one
date Sat, 26 Jan 2013 18:29:45 +0900
parents
children bf24d5200770
comparison
equal deleted inserted replaced
0:6f44308ee519 1:b997f2ce1a04
1 package alice.test.topology.aquarium.fx;
2
3 import alice.codesegment.CodeSegment;
4 import alice.datasegment.CommandType;
5 import alice.datasegment.Receiver;
6
7
8 public class Share extends CodeSegment {
9
10 private Receiver data = ids.create(CommandType.PEEK);
11 private Receiver list = ids.create(CommandType.PEEK);
12
13 public Share(String key) {
14 list.setKey("list");
15 data.setKey(key);
16 }
17
18 public Share(String key, int index) {
19 list.setKey("list");
20 data.setKey(key, index);
21 }
22
23 @Override
24 public void run() {
25 RoutingTable rt = this.list.asClass(RoutingTable.class);
26 for (RoutingData r : rt.table) {
27 if (!r.name.equals(data.from)) {
28 ods.update(r.name, data.key, data.val);
29 }
30 }
31
32 new Share(data.key,data.index);
33 }
34
35 }