# HG changeset patch
# User kono
# Date 1405243012 -32400
# Node ID 1cdde53a7ce8a365754583e5002a303be8b5adf1
# Parent 13ececb7e35ee2f4754c24c6efe9864d0101ecfe# Parent 48f815fa7f7468ac7784c839cef783750b3f4c94
merge
diff -r 48f815fa7f74 -r 1cdde53a7ce8 .classpath
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.classpath Sun Jul 13 18:16:52 2014 +0900
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 48f815fa7f74 -r 1cdde53a7ce8 .project
diff -r 48f815fa7f74 -r 1cdde53a7ce8 .settings/org.eclipse.jdt.core.prefs
--- a/.settings/org.eclipse.jdt.core.prefs Sun Jul 13 18:14:00 2014 +0900
+++ b/.settings/org.eclipse.jdt.core.prefs Sun Jul 13 18:16:52 2014 +0900
@@ -1,12 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.8
diff -r 48f815fa7f74 -r 1cdde53a7ce8 _classpath
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/_classpath Sun Jul 13 18:16:52 2014 +0900
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 48f815fa7f74 -r 1cdde53a7ce8 pom.xml
--- a/pom.xml Sun Jul 13 18:14:00 2014 +0900
+++ b/pom.xml Sun Jul 13 18:16:52 2014 +0900
@@ -27,11 +27,17 @@
4.7
test
-
- org.mortbay.jetty
- jetty
- 6.1.26
-
+
+ org.eclipse.jetty
+ jetty-server
+ 9.2.1.v20140609
+
+
+ org.eclipse.jetty
+ jetty-servlet
+ 9.2.1.v20140609
+
+
org.hectorclient
hector-core
@@ -49,11 +55,6 @@
- alice
- alice
- 0.2
-
-
org.msgpack
msgpack
0.6.8
diff -r 48f815fa7f74 -r 1cdde53a7ce8 src/main/java/alice/jungle/persistent/PersistentJournal.java
--- a/src/main/java/alice/jungle/persistent/PersistentJournal.java Sun Jul 13 18:14:00 2014 +0900
+++ b/src/main/java/alice/jungle/persistent/PersistentJournal.java Sun Jul 13 18:16:52 2014 +0900
@@ -14,7 +14,7 @@
public class PersistentJournal implements NetworkJournal {
- private ChangeListWriter WRITER;
+ // private ChangeListWriter WRITER;
private ChangeListReader READER;
private OutputStream out;
private InputStream in;
@@ -25,7 +25,7 @@
public PersistentJournal(File file) throws FileNotFoundException {
out = new FileOutputStream(file,true);
in = new FileInputStream(file);
- WRITER = new PersistentChangeListWriter(out);
+ // WRITER = new PersistentChangeListWriter(out);
READER = new PersistentChangeListReader(in);
}
@@ -58,7 +58,7 @@
public void setOutputStream(OutputStream _out) {
out = _out;
- WRITER = new PersistentChangeListWriter(out);
+ // WRITER = new PersistentChangeListWriter(out);
}
public OutputStream getOutputStream() {
diff -r 48f815fa7f74 -r 1cdde53a7ce8 src/main/java/alice/jungle/remote/RemoteConfig.java
--- a/src/main/java/alice/jungle/remote/RemoteConfig.java Sun Jul 13 18:14:00 2014 +0900
+++ b/src/main/java/alice/jungle/remote/RemoteConfig.java Sun Jul 13 18:16:52 2014 +0900
@@ -17,4 +17,5 @@
}
}
}
+
}
diff -r 48f815fa7f74 -r 1cdde53a7ce8 src/main/java/app/bbs/DistributeApp.java
--- a/src/main/java/app/bbs/DistributeApp.java Sun Jul 13 18:14:00 2014 +0900
+++ b/src/main/java/app/bbs/DistributeApp.java Sun Jul 13 18:16:52 2014 +0900
@@ -1,16 +1,19 @@
package app.bbs;
-
import alice.jungle.remote.RemoteConfig;
import alice.topology.node.TopologyNode;
import app.bbs.codesegment.StartBBSCodeSegment;
-
-public class DistributeApp
-{
- public static void main( String[] args ) throws Exception
- {
- RemoteConfig conf = new RemoteConfig(args);
- new TopologyNode(conf, new StartBBSCodeSegment(args, conf.bbsPort));
+public class DistributeApp {
+ public static void main(String[] args) throws Exception {
+ RemoteConfig conf = new RemoteConfig(args);
+ if (conf.getManagerHostName() == null) {
+ // String localHostName ="localhost";
+ // HostMessage host = new HostMessage(localHostName, conf.localPort);
+ StartBBSCodeSegment cs1 = new StartBBSCodeSegment(args, conf.bbsPort);
+ cs1.ods.put("host", "node0");
+ } else {
+ new TopologyNode(conf, new StartBBSCodeSegment(args, conf.bbsPort));
+ }
}
}
diff -r 48f815fa7f74 -r 1cdde53a7ce8 src/main/java/app/bbs/ShowMessageWithTimeStampServlet.java
--- a/src/main/java/app/bbs/ShowMessageWithTimeStampServlet.java Sun Jul 13 18:14:00 2014 +0900
+++ b/src/main/java/app/bbs/ShowMessageWithTimeStampServlet.java Sun Jul 13 18:16:52 2014 +0900
@@ -6,58 +6,62 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.eclipse.jetty.util.thread.ThreadPool;
+
import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BoardMessage;
-public class ShowMessageWithTimeStampServlet extends HttpServlet
-{
- /**
+public class ShowMessageWithTimeStampServlet extends HttpServlet {
+ /**
*
*/
- private static final long serialVersionUID = 1L;
- private final NetworkBulletinBoard bbs;
- private final String createBoardMessagePath;
- private final String editMessagePath;
-
- private static final String PARAM_BOARD_NAME = "bname";
+ private static final long serialVersionUID = 1L;
+ private final NetworkBulletinBoard bbs;
+ private final String createBoardMessagePath;
+ private final String editMessagePath;
+
+ private static final String PARAM_BOARD_NAME = "bname";
- public ShowMessageWithTimeStampServlet(NetworkBulletinBoard _bbs,String _createBoardMessagePath, String _editMessagePath)
- {
- bbs = _bbs;
- createBoardMessagePath = _createBoardMessagePath;
- editMessagePath = _editMessagePath;
- }
+ public ShowMessageWithTimeStampServlet(NetworkBulletinBoard _bbs,
+ String _createBoardMessagePath, String _editMessagePath,
+ ThreadPool thp) {
+ bbs = _bbs;
+ createBoardMessagePath = _createBoardMessagePath;
+ editMessagePath = _editMessagePath;
+ }
+
+ public void doGet(HttpServletRequest _req, HttpServletResponse _res) {
+ final String bname = _req.getParameter(PARAM_BOARD_NAME);
+ try {
+ printBoard(bname, _res.getWriter());
+ } catch (Exception _e) {
+ _res.setStatus(500);
+ }
+ }
- public void doGet(HttpServletRequest _req,HttpServletResponse _res)
- {
- String bname = _req.getParameter(PARAM_BOARD_NAME);
-
- try{
- printBoard(bname,_res.getWriter());
- }catch(Exception _e){
- _res.setStatus(500);
- }
-
- }
-
- private void printBoard(String _bname,PrintWriter _pw) throws Exception
- {
- _pw.write("\n");
- _pw.write(""+_bname+"
\n");
- _pw.write("Latest renew time : "+bbs.getRenewTime(_bname)+"
\n");;
-
- _pw.write("
\n");
- _pw.write("Message
\n");
- _pw.write("\n");
-
- for(BoardMessage msg : bbs.getMessages(_bname)){
- _pw.write("
");
- _pw.write(""+msg.getAuthor()+"
");
- _pw.write(""+msg.getMessage()+"
");
- _pw.write("edit");
- }
-
- _pw.write("");
- _pw.flush();
- }
+ private void printBoard(String _bname, PrintWriter _pw) throws Exception {
+ _pw.write("\n");
+ _pw.write("" + _bname + "
\n");
+ _pw.write("Latest renew time : " + bbs.getRenewTime(_bname)
+ + "
\n");
+ ;
+
+ _pw.write("