Mercurial > hg > Database > jungle-network
diff 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 |
line wrap: on
line diff
--- a/src/jungle/test/bbs/DistributeApp.java Tue Jul 09 15:10:06 2013 +0900 +++ b/src/jungle/test/bbs/DistributeApp.java Tue Jul 09 17:32:06 2013 +0900 @@ -2,6 +2,9 @@ import javax.servlet.Servlet; +import jungle.test.bbs.codesegment.PutAnotherLogCodeSegment; +import jungle.test.bbs.codesegment.PutHostLogCodeSegment; + import org.mortbay.jetty.Server; import org.mortbay.jetty.servlet.ServletHandler; import org.mortbay.jetty.servlet.ServletHolder; @@ -22,12 +25,18 @@ BulletinBoard cassaBBS = null; cassaBBS = new NetworkJungleBulletinBoard(); RemoteConfig conf = new RemoteConfig(args); - new AliceDaemon(conf).listen(); - if(conf.hostname != null) { + if(conf.hostname == null) { + /* Host Side */ + new AliceDaemon(conf).listen(); + PutHostLogCodeSegment cs = new PutHostLogCodeSegment(); + cs.arg1.setKey("local","log"); + } else { + /* Client Side */ DataSegment.connect(conf.key, "", conf.hostname, conf.connectPort); LogUpdateCodeSegment cs = new LogUpdateCodeSegment(); - cs.arg1.setKey("remote", "log"); - + cs.arg1.setKey("remote", "hostLog"); + PutAnotherLogCodeSegment cs2 = new PutAnotherLogCodeSegment(); + cs2.arg1.setKey("local", "log"); }