Closing ticket 352
This commit is contained in:
parent
2b4c1f28b5
commit
88f5344893
5 changed files with 39 additions and 29 deletions
|
|
@ -64,7 +64,7 @@ object SimpleRestService extends RestHelper {
|
|||
case Get("liftcount" :: _, req) =>
|
||||
//Fetch the first actor of type SimpleServiceActor
|
||||
//Send it the "Tick" message and expect a Node back
|
||||
val result = for( a <- ActorRegistry.actorsFor(classOf[SimpleServiceActor]).headOption;
|
||||
val result = for( a <- ActorRegistry.actorFor[SimpleServiceActor];
|
||||
r <- (a !! "Tick").as[Node] ) yield r
|
||||
|
||||
//Return either the resulting NodeSeq or a default one
|
||||
|
|
@ -85,7 +85,7 @@ object SimpleRestService extends RestHelper {
|
|||
case Get("persistentliftcount" :: _, req) =>
|
||||
//Fetch the first actor of type SimpleServiceActor
|
||||
//Send it the "Tick" message and expect a Node back
|
||||
val result = for( a <- ActorRegistry.actorsFor(classOf[PersistentServiceActor]).headOption;
|
||||
val result = for( a <- ActorRegistry.actorFor[PersistentServiceActor];
|
||||
r <- (a !! "Tick").as[Node] ) yield r
|
||||
|
||||
//Return either the resulting NodeSeq or a default one
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import java.lang.Integer
|
|||
import java.nio.ByteBuffer
|
||||
import javax.ws.rs.core.MultivaluedMap
|
||||
import javax.ws.rs.{GET, POST, Path, Produces, WebApplicationException, Consumes,PathParam}
|
||||
import se.scalablesolutions.akka.actor.ActorRegistry.actorsFor
|
||||
import se.scalablesolutions.akka.actor.ActorRegistry.actorFor
|
||||
import org.atmosphere.annotation.{Broadcast, Suspend,Cluster}
|
||||
import org.atmosphere.util.XSSHtmlFilter
|
||||
import org.atmosphere.cpr.{Broadcaster, BroadcastFilter}
|
||||
|
|
@ -53,7 +53,7 @@ class SimpleService {
|
|||
def count = {
|
||||
//Fetch the first actor of type SimpleServiceActor
|
||||
//Send it the "Tick" message and expect a NodeSeq back
|
||||
val result = for{a <- actorsFor(classOf[SimpleServiceActor]).headOption
|
||||
val result = for{a <- actorFor[SimpleServiceActor]
|
||||
r <- (a !! "Tick").as[NodeSeq]} yield r
|
||||
//Return either the resulting NodeSeq or a default one
|
||||
result getOrElse <error>Error in counter</error>
|
||||
|
|
@ -108,7 +108,7 @@ class PersistentSimpleService {
|
|||
def count = {
|
||||
//Fetch the first actor of type PersistentSimpleServiceActor
|
||||
//Send it the "Tick" message and expect a NodeSeq back
|
||||
val result = for{a <- actorsFor(classOf[PersistentSimpleServiceActor]).headOption
|
||||
val result = for{a <- actorFor[PersistentSimpleServiceActor]
|
||||
r <- (a !! "Tick").as[NodeSeq]} yield r
|
||||
//Return either the resulting NodeSeq or a default one
|
||||
result getOrElse <error>Error in counter</error>
|
||||
|
|
@ -155,7 +155,7 @@ class Chat {
|
|||
val msg = ChatMsg(form.getFirst("name"),form.getFirst("action"),form.getFirst("message"))
|
||||
//Fetch the first actor of type ChatActor
|
||||
//Send it the "Tick" message and expect a NodeSeq back
|
||||
val result = for{a <- actorsFor(classOf[ChatActor]).headOption
|
||||
val result = for{a <- actorFor[ChatActor]
|
||||
r <- (a !! msg).as[String]} yield r
|
||||
//Return either the resulting String or a default one
|
||||
result getOrElse "System__error"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import se.scalablesolutions.akka.config.ScalaConfig._
|
|||
import se.scalablesolutions.akka.util.Logging
|
||||
import se.scalablesolutions.akka.security.{BasicAuthenticationActor,BasicCredentials,SpnegoAuthenticationActor,DigestAuthenticationActor, UserInfo}
|
||||
import se.scalablesolutions.akka.stm.TransactionalMap
|
||||
import se.scalablesolutions.akka.actor.ActorRegistry.actorsFor
|
||||
import se.scalablesolutions.akka.actor.ActorRegistry.actorFor
|
||||
|
||||
class Boot {
|
||||
val factory = SupervisorFactory(
|
||||
|
|
@ -122,7 +122,7 @@ class SecureTickService {
|
|||
def tick = {
|
||||
//Fetch the first actor of type PersistentSimpleServiceActor
|
||||
//Send it the "Tick" message and expect a NdeSeq back
|
||||
val result = for{a <- actorsFor(classOf[SecureTickActor]).headOption
|
||||
val result = for{a <- actorFor[SecureTickActor]
|
||||
r <- (a !! "Tick").as[Integer]} yield r
|
||||
//Return either the resulting NodeSeq or a default one
|
||||
result match {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue