From 67f6a66fdb85cc4280b7b334a70b73de7cbafb1a Mon Sep 17 00:00:00 2001 From: jboner Date: Mon, 19 Oct 2009 10:52:18 +0200 Subject: [PATCH] fixed sample problem --- akka-samples-security/src/main/scala/SimpleService.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/akka-samples-security/src/main/scala/SimpleService.scala b/akka-samples-security/src/main/scala/SimpleService.scala index 3afa587d04..2f38c23ef9 100644 --- a/akka-samples-security/src/main/scala/SimpleService.scala +++ b/akka-samples-security/src/main/scala/SimpleService.scala @@ -34,8 +34,7 @@ class Boot { /* * In akka.conf you can set the FQN of any AuthenticationActor of your wish, under the property name: akka.rest.authenticator */ -class SimpleAuthenticationService extends DigestAuthenticationActor -{ +class SimpleAuthenticationService extends DigestAuthenticationActor { //If you want to have a distributed nonce-map, you can use something like below, //don't forget to configure your standalone Cassandra instance // @@ -67,7 +66,7 @@ class SecureService extends Actor with Logging { case object Tick private val KEY = "COUNTER"; private var hasStartedTicking = false; - private val storage = TransactionalState.newMap + private val storage = TransactionalState.newMap[String, Integer] @GET @Produces(Array("text/html")) @@ -76,7 +75,7 @@ class SecureService extends Actor with Logging { override def receive: PartialFunction[Any, Unit] = { case Tick => if (hasStartedTicking) { - val counter = storage.get(KEY).get.asInstanceOf[Integer].intValue + val counter = storage.get(KEY).get.intValue storage.put(KEY, new Integer(counter + 1)) reply(Tick:{counter + 1}) } else {