diff --git a/akka-http/src/main/scala/Security.scala b/akka-http/src/main/scala/Security.scala
index 72d79db3d9..284d82d98e 100644
--- a/akka-http/src/main/scala/Security.scala
+++ b/akka-http/src/main/scala/Security.scala
@@ -23,8 +23,9 @@
package se.scalablesolutions.akka.security
import se.scalablesolutions.akka.actor.{Scheduler, Actor, ActorRef, ActorRegistry}
-import se.scalablesolutions.akka.util.Logging
+import se.scalablesolutions.akka.actor.Actor._
import se.scalablesolutions.akka.config.Config
+import se.scalablesolutions.akka.util.Logging
import com.sun.jersey.api.model.AbstractMethod
import com.sun.jersey.spi.container.{ResourceFilterFactory, ContainerRequest, ContainerRequestFilter, ContainerResponse, ContainerResponseFilter, ResourceFilter}
@@ -87,7 +88,7 @@ class AkkaSecurityFilterFactory extends ResourceFilterFactory with Logging {
override def filter(request: ContainerRequest): ContainerRequest =
rolesAllowed match {
case Some(roles) => {
- val result : Option[AnyRef] = authenticator !! Authenticate(request, roles)
+ val result = (authenticator !! Authenticate(request, roles)).as[AnyRef]
result match {
case Some(OK) => request
case Some(r) if r.isInstanceOf[Response] =>
diff --git a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
index abe76ebcfa..01e1738b87 100644
--- a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
+++ b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
@@ -63,10 +63,10 @@ case class ChatMessage(from: String, message: String) extends Event
class ChatClient(val name: String) {
val chat = RemoteClient.actorFor("chat:service", "localhost", 9999)
- def login = chat ! Login(name)
- def logout = chat ! Logout(name)
+ def login = chat ! Login(name)
+ def logout = chat ! Logout(name)
def post(message: String) = chat ! ChatMessage(name, name + ": " + message)
- def chatLog: ChatLog = (chat !! GetChatLog(name)).getOrElse(throw new Exception("Couldn't get the chat log from ChatServer"))
+ def chatLog = (chat !! GetChatLog(name)).as[ChatLog].getOrElse(throw new Exception("Couldn't get the chat log from ChatServer"))
}
/**
diff --git a/akka-samples/akka-sample-rest-scala/src/main/scala/SimpleService.scala b/akka-samples/akka-sample-rest-scala/src/main/scala/SimpleService.scala
index 0a5af80a57..870739bf8f 100644
--- a/akka-samples/akka-sample-rest-scala/src/main/scala/SimpleService.scala
+++ b/akka-samples/akka-sample-rest-scala/src/main/scala/SimpleService.scala
@@ -54,7 +54,7 @@ class SimpleService {
//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
- r <- a.!} yield r
+ r <- (a !! "Tick").as[NodeSeq]} yield r
//Return either the resulting NodeSeq or a default one
result getOrElse Error in counter
}
@@ -109,7 +109,7 @@ class PersistentSimpleService {
//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
- r <- a.!} yield r
+ r <- (a !! "Tick").as[NodeSeq]} yield r
//Return either the resulting NodeSeq or a default one
result getOrElse Error in counter
}
@@ -156,7 +156,7 @@ class Chat {
//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
- r <- a.!} yield r
+ r <- (a !! msg).as[String]} yield r
//Return either the resulting String or a default one
result getOrElse "System__error"
}
diff --git a/akka-samples/akka-sample-security/src/main/scala/SimpleService.scala b/akka-samples/akka-sample-security/src/main/scala/SimpleService.scala
index 061555ef05..e5c8029eb8 100644
--- a/akka-samples/akka-sample-security/src/main/scala/SimpleService.scala
+++ b/akka-samples/akka-sample-security/src/main/scala/SimpleService.scala
@@ -123,7 +123,7 @@ class SecureTickService {
//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
- r <- a.!} yield r
+ r <- (a !! "Tick").as[Integer]} yield r
//Return either the resulting NodeSeq or a default one
result match {
case (Some(counter)) => (Tick: {counter})