78
|
1 package fdl.test.topology.ring;
|
76
|
2
|
|
3 import java.io.IOException;
|
|
4
|
78
|
5 import fdl.MetaEngine;
|
|
6 import fdl.test.topology.FDLindaNode;
|
|
7
|
|
8 /**
|
|
9 * RingTopologyManager
|
|
10 *
|
|
11 * @author Kazuki Akamine
|
|
12 *
|
|
13 * FDLindaNode の Topology を管理する Server
|
|
14 * Ring 実験用の Main Class
|
|
15 *
|
|
16 */
|
76
|
17
|
78
|
18 public class RingTopologyManager {
|
|
19 private static int localPort = 10000;
|
|
20 private static int nodeNum;
|
|
21 private static String usageString
|
|
22 = "RingTopologyManager -nodes NODENUM";
|
|
23
|
|
24 public static void main(String[] args) {
|
|
25 for (int i = 0; i < args.length; i++) {
|
|
26 if ("-nodes".equals(args[i])) {
|
|
27 nodeNum = Integer.parseInt(args[++i]);
|
|
28 } else {
|
|
29 System.err.println(usageString);
|
|
30 }
|
|
31 }
|
|
32 try {
|
|
33 FDLindaNode manager = new FDLindaNode(localPort);
|
|
34 MetaEngine me = new RingTopologyManagerEngine(manager.getMetaLinda(), nodeNum);
|
|
35 manager.setMetaEngine(me);
|
|
36 manager.mainLoop();
|
|
37 } catch (IOException e) {
|
|
38 e.printStackTrace();
|
|
39 }
|
76
|
40 }
|
|
41 }
|