Mercurial > hg > Members > shoshi > jungle > bulletinboard
changeset 10:a5a706618c9d
Jetty update 6 to 7
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 06 Feb 2014 18:08:28 +0900 |
parents | 5383ee926c6f |
children | 7db91cd56245 |
files | pom.xml src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/bbs/App.java |
diffstat | 2 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/pom.xml Tue Jan 28 22:04:32 2014 +0900 +++ b/pom.xml Thu Feb 06 18:08:28 2014 +0900 @@ -24,7 +24,7 @@ <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty</artifactId> - <version>6.1.26</version> + <version>7.0.0.pre5</version> </dependency> <dependency> <groupId>org.hectorclient</groupId>
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/bbs/App.java Tue Jan 28 22:04:32 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/bbs/App.java Thu Feb 06 18:08:28 2014 +0900 @@ -4,9 +4,12 @@ import me.prettyprint.hector.api.HConsistencyLevel; +import org.mortbay.jetty.Connector; import org.mortbay.jetty.Server; +import org.mortbay.jetty.nio.SelectChannelConnector; import org.mortbay.jetty.servlet.ServletHandler; import org.mortbay.jetty.servlet.ServletHolder; +import org.mortbay.thread.QueuedThreadPool; @@ -56,7 +59,13 @@ Servlet index = new ShowBoardsServlet(cassaBBS,createBoardPath,showBoardMessagePath); Servlet board = new ShowBoardMessageServlet(cassaBBS,createBoardMessagePath,editMessagePath); - Server serv = new Server(8080); +// Server serv = new Server(8080); + Server serv = new Server(); + SelectChannelConnector connector = new SelectChannelConnector(); + connector.setPort(8080); + connector.setThreadPool(new QueuedThreadPool(1000)); + serv.setConnectors(new Connector[] { connector }); + ServletHandler context = new ServletHandler(); context.addServletWithMapping(new ServletHolder(createBoardMessage),createBoardMessagePath); context.addServletWithMapping(new ServletHolder(createBoard),createBoardPath); @@ -66,10 +75,12 @@ /* * For write benchmark */ +/* String editMessageUseGetPath = "/editMessageUseGet"; Servlet editMessageUseGet = new EditMessageUseGetServlet(cassaBBS); context.addServletWithMapping(new ServletHolder(editMessageUseGet), editMessageUseGetPath); - +*/ + serv.addHandler(context); serv.start();