Mercurial > hg > FederatedLinda
comparison src/fdl/test/debug2/ConfigurationManager.java @ 92:ea4ee892baf5
commit
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 22 Apr 2010 16:13:03 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
91:4df1d50df52a | 92:ea4ee892baf5 |
---|---|
1 package fdl.test.debug2; | |
2 | |
3 import java.io.IOException; | |
4 | |
5 import fdl.MetaEngine; | |
6 | |
7 /** | |
8 * ConfigurationManager | |
9 * | |
10 * @author Kazuki Akamine | |
11 * | |
12 * FDLindaNode を管理する Server | |
13 * | |
14 */ | |
15 | |
16 public class ConfigurationManager { | |
17 private static int nodeNum = 2; | |
18 private static int relayNum = 1; | |
19 private static int relaySize = 1024; | |
20 private static String usageString | |
21 = "ConfigurationManager -nodes NODENUM -relay RELAYNUM -size RELAYSIZE"; | |
22 | |
23 public static void main(String[] args) { | |
24 for (int i = 0; i < args.length; i++) { | |
25 if ("-nodes".equals(args[i])) { | |
26 nodeNum = Integer.parseInt(args[++i]); | |
27 } else if ("-relay".equals(args[i])) { | |
28 relayNum = Integer.parseInt(args[++i]); | |
29 } else if ("-size".equals(args[i])) { | |
30 relaySize = Integer.parseInt(args[++i]); | |
31 } else { | |
32 System.err.println(usageString); | |
33 } | |
34 } | |
35 try { | |
36 FDLindaNode manager = new FDLindaNode(FDLindaNode.DEFAULTPORT); | |
37 MetaEngine me = new ConfigurationManagerEngine(manager.getMetaLinda(), nodeNum, relayNum, relaySize); | |
38 manager.setMetaEngine(me); | |
39 manager.mainLoop(); | |
40 } catch (IOException e) { | |
41 e.printStackTrace(); | |
42 } | |
43 } | |
44 | |
45 } |