annotate src/fdl/test/transfer/cluster/FDLServWithSend.java @ 57:48bb577a313f

Protocol Engine for cluster
author axmo
date Thu, 12 Feb 2009 14:42:27 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
57
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
1 package fdl.test.transfer.cluster;
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
2
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
3 import java.io.IOException;
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
4
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
5 import fdl.FDLindaServ;
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
6 import fdl.MetaLinda;
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
7
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
8
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
9 public class FDLServWithSend extends FDLindaServ {
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
10 public FDLServWithSend(int port) throws IOException {
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
11 super(port);
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
12 }
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
13
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
14 private static String host = "localhost";
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
15
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
16 @Override public void mainLoop() {
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
17 System.out.println("change mainloop");
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
18 MetaLinda ml = new MetaLinda(tupleSpace, this);
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
19 mpe = new MetaProtocolEngine(ml, host);
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
20 mpe.mainLoop();
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
21 }
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
22
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
23 public static void main(String[] args){
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
24 for (int i=0; i<args.length; ++i) {
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
25 if("-send".equals(args[i])){
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
26 host = args[++i];
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
27 } else {
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
28 System.err.println("引数指定の誤り:未知の引数が指定されました");
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
29 }
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
30 }
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
31 try {
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
32 FDLServWithSend serv;
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
33 serv = new FDLServWithSend(10000);
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
34 serv.mainLoop();
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
35 } catch (IOException e) {
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
36 e.printStackTrace();
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
37 }
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
38 }
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
39
48bb577a313f Protocol Engine for cluster
axmo
parents:
diff changeset
40 }