Mercurial > hg > Database > jungle-network
comparison src/jungle/test/bbs/DistributeApp.java @ 40:7e94de2d6bc0
add PutAnotherLogCodeSegment, PutHostLogCodeSegment
author | one |
---|---|
date | Tue, 09 Jul 2013 17:32:06 +0900 |
parents | 10359a815068 |
children | 4419ac56cbfd |
comparison
equal
deleted
inserted
replaced
39:10359a815068 | 40:7e94de2d6bc0 |
---|---|
1 package jungle.test.bbs; | 1 package jungle.test.bbs; |
2 | 2 |
3 import javax.servlet.Servlet; | 3 import javax.servlet.Servlet; |
4 | |
5 import jungle.test.bbs.codesegment.PutAnotherLogCodeSegment; | |
6 import jungle.test.bbs.codesegment.PutHostLogCodeSegment; | |
4 | 7 |
5 import org.mortbay.jetty.Server; | 8 import org.mortbay.jetty.Server; |
6 import org.mortbay.jetty.servlet.ServletHandler; | 9 import org.mortbay.jetty.servlet.ServletHandler; |
7 import org.mortbay.jetty.servlet.ServletHolder; | 10 import org.mortbay.jetty.servlet.ServletHolder; |
8 | 11 |
20 public static void main( String[] args ) throws Exception | 23 public static void main( String[] args ) throws Exception |
21 { | 24 { |
22 BulletinBoard cassaBBS = null; | 25 BulletinBoard cassaBBS = null; |
23 cassaBBS = new NetworkJungleBulletinBoard(); | 26 cassaBBS = new NetworkJungleBulletinBoard(); |
24 RemoteConfig conf = new RemoteConfig(args); | 27 RemoteConfig conf = new RemoteConfig(args); |
25 new AliceDaemon(conf).listen(); | 28 if(conf.hostname == null) { |
26 if(conf.hostname != null) { | 29 /* Host Side */ |
30 new AliceDaemon(conf).listen(); | |
31 PutHostLogCodeSegment cs = new PutHostLogCodeSegment(); | |
32 cs.arg1.setKey("local","log"); | |
33 } else { | |
34 /* Client Side */ | |
27 DataSegment.connect(conf.key, "", conf.hostname, conf.connectPort); | 35 DataSegment.connect(conf.key, "", conf.hostname, conf.connectPort); |
28 LogUpdateCodeSegment cs = new LogUpdateCodeSegment(); | 36 LogUpdateCodeSegment cs = new LogUpdateCodeSegment(); |
29 cs.arg1.setKey("remote", "log"); | 37 cs.arg1.setKey("remote", "hostLog"); |
30 | 38 PutAnotherLogCodeSegment cs2 = new PutAnotherLogCodeSegment(); |
39 cs2.arg1.setKey("local", "log"); | |
31 } | 40 } |
32 | 41 |
33 | 42 |
34 String createBoardMessagePath = "/createBoardMessage"; | 43 String createBoardMessagePath = "/createBoardMessage"; |
35 String createBoardPath = "/createBoard"; | 44 String createBoardPath = "/createBoard"; |