scalacount should work now.
This commit is contained in:
parent
352d4b6c2a
commit
b8fe12c215
21 changed files with 155 additions and 91 deletions
|
|
@ -39,34 +39,25 @@ CLASSPATH=$CLASSPATH:$LIB_DIR/commons-logging-1.0.4.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/commons-math-1.1.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/commons-math-1.1.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/configgy-1.3.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/configgy-1.3.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/google-collect-snapshot-20090211.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/google-collect-snapshot-20090211.jar
|
||||||
#CLASSPATH=$CLASSPATH:$LIB_DIR/grizzly-framework-1.8.6.3.jar
|
|
||||||
#CLASSPATH=$CLASSPATH:$LIB_DIR/grizzly-http-1.8.6.3.jar
|
|
||||||
#CLASSPATH=$CLASSPATH:$LIB_DIR/grizzly-http-servlet-1.8.6.3.jar
|
|
||||||
#CLASSPATH=$CLASSPATH:$LIB_DIR/grizzly-http-utils-1.9.1.jar
|
|
||||||
#CLASSPATH=$CLASSPATH:$LIB_DIR/grizzly-servlet-webserver-1.8.6.3.jar
|
|
||||||
#CLASSPATH=$CLASSPATH:$LIB_DIR/grizzly-comet-1.8.6.3.jar
|
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/grizzly-comet-webserver-1.8.6.3.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/grizzly-comet-webserver-1.8.6.3.jar
|
||||||
#CLASSPATH=$CLASSPATH:$LIB_DIR/grizzly-comet-webserver-1.9.17-RC2.jar
|
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/guice-core-2.0-SNAPSHOT.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/guice-core-2.0-SNAPSHOT.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/guice-jsr250-2.0-SNAPSHOT.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/guice-jsr250-2.0-SNAPSHOT.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/high-scale-lib.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/high-scale-lib.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/jackson-core-asl-1.1.0.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/jackson-core-asl-1.1.0.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/jackson-mapper-asl-1.1.0.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/jackson-mapper-asl-1.1.0.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-client-1.1.0-ea.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-client-1.1.1-ea.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-core-1.0.3.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-core-1.1.1-ea.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-json-1.0.3.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-json-1.1.1-ea.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-server-1.0.3.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-server-1.1.1-ea.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-scala-1.1.2-ea-SNAPSHOT.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/jersey-scala-1.1.2-ea-SNAPSHOT.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/atmosphere-core-0.3-SNAPSHOT.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/atmosphere-core-0.3.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/atmosphere-portable-runtime-0.3-SNAPSHOT.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/atmosphere-portable-runtime-0.3.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/atmosphere-compat-0.3-SNAPSHOT.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/atmosphere-compat-0.3.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/JSAP-2.1.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/JSAP-2.1.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/jsr250-api-1.0.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/jsr250-api-1.0.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/jsr311-api-1.0.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/jsr311-api-1.0.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/libfb303.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/libfb303.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/libthrift.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/libthrift.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/lift-webkit-1.1-M3.jar
|
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/lift-util-1.1-M3.jar
|
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/log4j-1.2.15.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/log4j-1.2.15.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/lucene-core-2.2.0.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/lucene-core-2.2.0.jar
|
||||||
CLASSPATH=$CLASSPATH:$LIB_DIR/netty-3.1.0.CR1.jar
|
CLASSPATH=$CLASSPATH:$LIB_DIR/netty-3.1.0.CR1.jar
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
9
deploy/root/META-INF/atmosphere.xml
Executable file
9
deploy/root/META-INF/atmosphere.xml
Executable file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<atmosphere-handlers>
|
||||||
|
<!-- Associate a context-root (servlet-mapping) to an AtmosphereHandler.
|
||||||
|
Request sent using that context-root will be mapped to its associated AtmosphereHandler
|
||||||
|
-->
|
||||||
|
<atmosphere-handler context-root="" class-name="se.scalablesolutions.akka.kernel.jersey.AkkaServlet" broadcaster="org.atmosphere.core.JerseyBroadcaster">
|
||||||
|
<!-- Define some AtmosphereHandler properties -->
|
||||||
|
<property name="com.sun.jersey.spi.container.ResourceFilters" value="org.atmosphere.core.AtmosphereFilter"/>
|
||||||
|
</atmosphere-handler>
|
||||||
|
</atmosphere-handlers>
|
||||||
5
deploy/root/META-INF/context.xml
Executable file
5
deploy/root/META-INF/context.xml
Executable file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Context>
|
||||||
|
<!-- <Loader className="org.atmosphere.util.AtmosphereClassloader"/> -->
|
||||||
|
<Loader delegate="true"/>
|
||||||
|
</Context>
|
||||||
19
deploy/root/jquery-1.3.2.min.js
vendored
Normal file
19
deploy/root/jquery-1.3.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +1,64 @@
|
||||||
<html>
|
<html>
|
||||||
<head><title>blah</title></head>
|
<head>
|
||||||
<body>
|
<title>Push Services Demo</title>
|
||||||
<form method="post" enctype="application/x-www-form-urlencoded" action="chat">
|
<script language="javascript" src="jquery-1.3.2.min.js">
|
||||||
<input name="action"/>
|
</script>
|
||||||
<input name="name"/>
|
<style>
|
||||||
<input name="message"/>
|
.hide {
|
||||||
<input type="submit" value="submit" name="submit"/>
|
visibility : hidden;
|
||||||
</form>
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body id="body">
|
||||||
|
<div id="container">
|
||||||
|
<div id="chat">
|
||||||
|
<div id="chatwindow">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="text" name="name" id="name"/>
|
||||||
|
<input type="button" name="login" value="Login" id="login" />
|
||||||
|
<textarea id="msg" class="hide" name="message" rows="10" cols="150"></textarea>
|
||||||
|
<input type="button" name="Send" id="send" value="Send" class="hide"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script language="javascript">
|
||||||
|
$(function(){
|
||||||
|
window.app = {
|
||||||
|
update : function(data) {
|
||||||
|
if(data && data.name)
|
||||||
|
$('#chatwindow').append('<p>' + data.name + (data.message ? (': ' + data.message) : '') + '</p>');
|
||||||
|
else
|
||||||
|
alert(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#send').click( function(e){
|
||||||
|
var message = $('#msg').val();
|
||||||
|
$('#msg').val('');
|
||||||
|
|
||||||
|
$.post('/chat',
|
||||||
|
{
|
||||||
|
'action' : 'post',
|
||||||
|
'name' : $('#name').val(),
|
||||||
|
'message' : message
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#login').click( function(e) {
|
||||||
|
$.post('/chat',
|
||||||
|
{
|
||||||
|
'action' : 'login',
|
||||||
|
'name' : $('#name').val()
|
||||||
|
},
|
||||||
|
function(data) { $('#login').hide();
|
||||||
|
$('#name').attr('disabled','disabled');
|
||||||
|
$('#msg').removeClass('hide');
|
||||||
|
$('#send').removeClass('hide');
|
||||||
|
$('<iframe style="display:hidden;" id="comet" src="/chat"></iframe>').appendTo('#body');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -119,12 +119,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sun.jersey</groupId>
|
<groupId>com.sun.jersey</groupId>
|
||||||
<artifactId>jersey-server</artifactId>
|
<artifactId>jersey-server</artifactId>
|
||||||
<version>1.0.3</version>
|
<version>1.1.1-ea</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sun.jersey</groupId>
|
<groupId>com.sun.jersey</groupId>
|
||||||
<artifactId>jersey-json</artifactId>
|
<artifactId>jersey-json</artifactId>
|
||||||
<version>1.0.3</version>
|
<version>1.1.1-ea</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
|
|
@ -145,17 +145,17 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.atmosphere</groupId>
|
<groupId>org.atmosphere</groupId>
|
||||||
<artifactId>atmosphere-core</artifactId>
|
<artifactId>atmosphere-core</artifactId>
|
||||||
<version>0.3-SNAPSHOT</version>
|
<version>0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.atmosphere</groupId>
|
<groupId>org.atmosphere</groupId>
|
||||||
<artifactId>atmosphere-portable-runtime</artifactId>
|
<artifactId>atmosphere-portable-runtime</artifactId>
|
||||||
<version>0.3-SNAPSHOT</version>
|
<version>0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.atmosphere</groupId>
|
<groupId>org.atmosphere</groupId>
|
||||||
<artifactId>atmosphere-compat</artifactId>
|
<artifactId>atmosphere-compat</artifactId>
|
||||||
<version>0.3-SNAPSHOT</version>
|
<version>0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>
|
<!--<dependency>
|
||||||
<groupId>org.atmosphere</groupId>
|
<groupId>org.atmosphere</groupId>
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ class AkkaServlet extends ServletContainer with AtmosphereServletProcessor with
|
||||||
val configurators = ConfiguratorRepository.getConfiguratorsFor(getServletContext)
|
val configurators = ConfiguratorRepository.getConfiguratorsFor(getServletContext)
|
||||||
|
|
||||||
rc.getClasses.addAll(configurators.flatMap(_.getComponentInterfaces))
|
rc.getClasses.addAll(configurators.flatMap(_.getComponentInterfaces))
|
||||||
|
log.info("ResourceFilters: " + rc.getProperty("com.sun.jersey.spi.container.ResourceFilters"));
|
||||||
rc.getProperties.put("com.sun.jersey.spi.container.ResourceFilters","org.atmosphere.core.AtmosphereFilter")
|
rc.getProperties.put("com.sun.jersey.spi.container.ResourceFilters","org.atmosphere.core.AtmosphereFilter")
|
||||||
//rc.getFeatures.put("com.sun.jersey.config.feature.Redirect", true)
|
//rc.getFeatures.put("com.sun.jersey.config.feature.Redirect", true)
|
||||||
//rc.getFeatures.put("com.sun.jersey.config.feature.ImplicitViewables",true)
|
//rc.getFeatures.put("com.sun.jersey.config.feature.ImplicitViewables",true)
|
||||||
|
|
@ -47,10 +48,6 @@ class AkkaServlet extends ServletContainer with AtmosphereServletProcessor with
|
||||||
|
|
||||||
//Borrowed from AbstractReflectorAtmosphereHandler
|
//Borrowed from AbstractReflectorAtmosphereHandler
|
||||||
override def onMessage(event : AtmosphereEvent[HttpServletRequest,HttpServletResponse]) : AtmosphereEvent[_,_] =
|
override def onMessage(event : AtmosphereEvent[HttpServletRequest,HttpServletResponse]) : AtmosphereEvent[_,_] =
|
||||||
{
|
|
||||||
//log.info("onMessage: " + event.getMessage.toString)
|
|
||||||
|
|
||||||
if(event.getMessage ne null)
|
|
||||||
{
|
{
|
||||||
var isUsingStream = false
|
var isUsingStream = false
|
||||||
try {
|
try {
|
||||||
|
|
@ -59,7 +56,7 @@ class AkkaServlet extends ServletContainer with AtmosphereServletProcessor with
|
||||||
case e: IllegalStateException => isUsingStream = true
|
case e: IllegalStateException => isUsingStream = true
|
||||||
}
|
}
|
||||||
|
|
||||||
val data = event.getMessage.toString
|
val data = if(event.getMessage ne null) event.getMessage.toString else null
|
||||||
|
|
||||||
if (isUsingStream){
|
if (isUsingStream){
|
||||||
if(data != null)
|
if(data != null)
|
||||||
|
|
@ -69,9 +66,6 @@ class AkkaServlet extends ServletContainer with AtmosphereServletProcessor with
|
||||||
event.getResponse.getWriter.write(data)
|
event.getResponse.getWriter.write(data)
|
||||||
event.getResponse.getWriter.flush
|
event.getResponse.getWriter.flush
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
log.info("Null event message :/ req[ " + event.getRequest + "] res[" +event.getResponse + "]")
|
|
||||||
|
|
||||||
event
|
event
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/atmosphere-compat-0.3.jar
Executable file
BIN
lib/atmosphere-compat-0.3.jar
Executable file
Binary file not shown.
BIN
lib/atmosphere-core-0.3-SNAPSHOT.jar → lib/atmosphere-core-0.3.jar
Normal file → Executable file
BIN
lib/atmosphere-core-0.3-SNAPSHOT.jar → lib/atmosphere-core-0.3.jar
Normal file → Executable file
Binary file not shown.
BIN
lib/atmosphere-portable-runtime-0.3-SNAPSHOT.jar → lib/atmosphere-portable-runtime-0.3.jar
Normal file → Executable file
BIN
lib/atmosphere-portable-runtime-0.3-SNAPSHOT.jar → lib/atmosphere-portable-runtime-0.3.jar
Normal file → Executable file
Binary file not shown.
BIN
lib/jersey-client-1.1.0-ea.jar → lib/jersey-client-1.1.1-ea.jar
Normal file → Executable file
BIN
lib/jersey-client-1.1.0-ea.jar → lib/jersey-client-1.1.1-ea.jar
Normal file → Executable file
Binary file not shown.
BIN
lib/jersey-core-1.0.3.jar → lib/jersey-core-1.1.1-ea.jar
Normal file → Executable file
BIN
lib/jersey-core-1.0.3.jar → lib/jersey-core-1.1.1-ea.jar
Normal file → Executable file
Binary file not shown.
Binary file not shown.
BIN
lib/jersey-json-1.1.1-ea.jar
Executable file
BIN
lib/jersey-json-1.1.1-ea.jar
Executable file
Binary file not shown.
BIN
lib/jersey-server-1.0.3.jar → lib/jersey-server-1.1.1-ea.jar
Normal file → Executable file
BIN
lib/jersey-server-1.0.3.jar → lib/jersey-server-1.1.1-ea.jar
Normal file → Executable file
Binary file not shown.
|
|
@ -20,6 +20,9 @@ class Boot {
|
||||||
override def getSupervisorConfig: SupervisorConfig = {
|
override def getSupervisorConfig: SupervisorConfig = {
|
||||||
SupervisorConfig(
|
SupervisorConfig(
|
||||||
RestartStrategy(OneForOne, 3, 100),
|
RestartStrategy(OneForOne, 3, 100),
|
||||||
|
Supervise(
|
||||||
|
new SimpleService,
|
||||||
|
LifeCycle(Permanent, 100)) ::
|
||||||
Supervise(
|
Supervise(
|
||||||
new Chat,
|
new Chat,
|
||||||
LifeCycle(Permanent, 100))
|
LifeCycle(Permanent, 100))
|
||||||
|
|
@ -84,15 +87,11 @@ class Chat extends Actor with Logging{
|
||||||
@Suspend
|
@Suspend
|
||||||
@GET
|
@GET
|
||||||
@Produces(Array("text/html"))
|
@Produces(Array("text/html"))
|
||||||
def suspend() = "<!-- Comet is a programming technique that enables web " +
|
@FilterBroadcast(Array(classOf[XSSHtmlFilter],classOf[JsonpFilter]))
|
||||||
"servers to send data to the client without having any need " +
|
def suspend() = <!-- Comet is a programming technique that enables web servers to send data to the client without having any need for the client to request it. -->
|
||||||
"for the client to request it. -->\n"
|
|
||||||
|
|
||||||
override def receive: PartialFunction[Any, Unit] = {
|
override def receive: PartialFunction[Any, Unit] = {
|
||||||
case Chat(who,what,msg) => {
|
case Chat(who,what,msg) => {
|
||||||
|
|
||||||
//log.info("Chat(" + who + ", " + what + ", " + msg + ")")
|
|
||||||
|
|
||||||
what match {
|
what match {
|
||||||
case "login" => reply("System Message__"+who+" has joined.")
|
case "login" => reply("System Message__"+who+" has joined.")
|
||||||
case "post" => reply("" + who + "__" + msg)
|
case "post" => reply("" + who + "__" + msg)
|
||||||
|
|
@ -108,15 +107,11 @@ class Chat extends Actor with Logging{
|
||||||
@Produces(Array("text/html"))
|
@Produces(Array("text/html"))
|
||||||
@FilterBroadcast(Array(classOf[XSSHtmlFilter],classOf[JsonpFilter]))
|
@FilterBroadcast(Array(classOf[XSSHtmlFilter],classOf[JsonpFilter]))
|
||||||
def publishMessage(form: MultivaluedMap[String, String]) = (this !! Chat(form.getFirst("name"),form.getFirst("action"),form.getFirst("message"))).getOrElse("System__error")
|
def publishMessage(form: MultivaluedMap[String, String]) = (this !! Chat(form.getFirst("name"),form.getFirst("action"),form.getFirst("message"))).getOrElse("System__error")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class JsonpFilter extends BroadcastFilter[String] with Logging
|
class JsonpFilter extends BroadcastFilter[String] with Logging
|
||||||
{
|
{
|
||||||
|
|
||||||
val BEGIN_SCRIPT_TAG = "<script type='text/javascript'>\n"
|
|
||||||
val END_SCRIPT_TAG = "</script>\n"
|
|
||||||
|
|
||||||
def filter(m : String) = {
|
def filter(m : String) = {
|
||||||
var name = m
|
var name = m
|
||||||
var message = ""
|
var message = ""
|
||||||
|
|
@ -126,9 +121,6 @@ class Chat extends Actor with Logging{
|
||||||
message = m.substring(m.indexOf("__") + 2)
|
message = m.substring(m.indexOf("__") + 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
(BEGIN_SCRIPT_TAG + "window.parent.app.update({ name: \""
|
("<script type='text/javascript'>\n (window.app || window.parent.app).update({ name: \"" + name + "\", message: \""+ message + "\" }); \n</script>\n")
|
||||||
+ name + "\", message: \""
|
|
||||||
+ message + "\" });\n"
|
|
||||||
+ END_SCRIPT_TAG)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue