This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mojolly.websocket | |
import org.eclipse.jetty.server.handler.AbstractHandler | |
import org.eclipse.jetty.server.{Request, Server} | |
import java.io.IOException | |
import javax.servlet.ServletException | |
import javax.servlet.http.{HttpServlet, HttpServletResponse, HttpServletRequest} | |
import org.eclipse.jetty.servlet.{ServletHolder, ServletContextHandler} | |
import org.eclipse.jetty.server.session.SessionHandler | |
import akka.actor.Scheduler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mojolly.websocket | |
import akka.actor.{Scheduler, Actor} | |
import java.util.concurrent.TimeUnit | |
import Actor._ | |
import org.jredis.ri.alphazero.JRedisClient | |
/* | |
* Gets executed by the listener defined in web.xml | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asyncGet("/route") { | |
// all methods below are optional so in reality you would only see 2 or 3 | |
init { continuation => | |
} | |
resumed { continuation => | |
} | |
expired { continuation => | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Usage: | |
//override def pomPostProcess(node: Node): Node = mcPom(moduleConfigurations)(super.pomPostProcess(node)) | |
trait McPom { self: DefaultProject => | |
import scala.xml._ | |
def mcPom(mcs: Set[ModuleConfiguration])(node: Node): Node = { | |
//make sure we have a trailing slash so we deduplicate URLs properly | |
def cleanUrl(url: String) = url match { | |
case null => "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mojolly.websocket | |
import org.scalatra._ | |
import javax.servlet.http.{HttpServletResponse, HttpServletRequest} | |
import org.eclipse.jetty.websocket.{WebSocket => ServletWebSocket, WebSocketFactory} | |
import akka.util.Logging | |
import java.io.UnsupportedEncodingException | |
import org.eclipse.jetty.websocket.WebSocket.Outbound | |
import collection.mutable.{ HashSet, SynchronizedSet } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "ConnFu demo application" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
console none | |
# the following ensures that the process is restarted when it should die unexpectedly | |
respawn | |
exec sudo -u randomuser -H bash -c "cd /home/randomuser/connfu-demo; PORT=14080 /home/randomuser/.rvm/rubies/jruby-1.5.6/bin/ruby -J-Xmx256m -J-Xms128m -J-Xmn64m --server --headless connfu-demo-server" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.scalatra | |
import socketio.{SocketIOServlet} | |
class SocketIOExample extends SocketIOServlet { | |
// overriden because otherwise you need a trailing slash for the root url | |
// prefer the freedom with or without root. | |
override def requestPath = { | |
val p = (Option(request.getPathInfo) getOrElse "").trim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ -129,16 +130,16 @@ class AkkaModulesParentProject(info: ProjectInfo) extends DefaultProject(info) { | |
lazy val ATMO_VERSION = "0.6.2" | |
lazy val CAMEL_VERSION = "2.5.0" | |
lazy val CASSANDRA_VERSION = "0.6.1" | |
- lazy val DISPATCH_VERSION = "0.7.4" | |
+ lazy val DISPATCH_VERSION = "0.7.8" | |
lazy val HAWT_DISPATCH_VERSION = "1.0" | |
lazy val JACKSON_VERSION = "1.4.3" | |
lazy val JERSEY_VERSION = "1.3" | |
lazy val MULTIVERSE_VERSION = "0.6.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% iterations.each do |iteration| %> | |
<h2 id='Sprint_<%= iteration.number %>' style='display:inline'>Sprint <%= iteration.number %></h2><i> - ends <%= iteration.finish.strftime("%Y-%m-%d") %></i><a href='#Sprint_<%= iteration.number %>' class='anchor'> ¶</a> | |
<ul> | |
<% iteration.stories.each do |story| %> | |
<li class='story'><h3 style='display:inline'><i>Story <%= story.id %> (<%= story.current_state %>)</i></h3> | |
<small class='taskCount'><i><%= " - #{story.tasks.size} tasks defined" if story.respond_to?(:tasks) %></i></small> | |
<p class='storyDescription'><span class="storyIngress"><%= story.name%></span><br><span class="storyRest" style="color:grey"></span></p> | |
<% end %> | |
</ul> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[error] x render hello | |
[error] '<html> | |
[error] <head> | |
[error] <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> | |
[error] <title>Error 500 com.mojolly.backchat.scalatra.tests.ScalatraTestServlet.pathPatternParser2RouteMatcher(Lorg/scalatra/PathPattern;)Lorg/scalatra/RouteMatcher;</title> | |
[error] </head> | |
[error] <body><h2>HTTP ERROR 500</h2> | |
[error] <p>Problem accessing /hello. Reason: | |
[error] <pre> com.mojolly.backchat.scalatra.tests.ScalatraTestServlet.pathPatternParser2RouteMatcher(Lorg/scalatra/PathPattern;)Lorg/scalatra/RouteMatcher;</pre></p><h3>Caused by:</h3><pre>java.lang.AbstractMethodError: com.mojolly.backchat.scalatra.tests.ScalatraTestServlet.pathPatternParser2RouteMatcher(Lorg/scalatra/PathPattern;)Lorg/scalatra/RouteMatcher; | |
[error] at org.scalatra.ScalatraKernel$class.string2RouteMatcher(ScalatraKernel.scala:81) |