import message.config.{ActorProviderConfigured, AquariumPropertiesLoaded}
import gr.grnet.aquarium.event.im.IMEventModel
import akka.config.Supervision.Temporary
-import akka.actor.PoisonPill
import gr.grnet.aquarium.{AquariumException, Configurator}
UserActorCache.invalidate(this._userID)
}
- self ! PoisonPill
+ self.stop()
}
override protected def onThrowable(t: Throwable, message: AnyRef) = {
.removalListener(EvictionListener)
.build()
- private[this] object EvictionListener
- extends RemovalListener[String, ActorRef] with Loggable {
+ private[this] object EvictionListener extends RemovalListener[String, ActorRef] with Loggable {
- def onRemoval(p1: RemovalNotification[String, ActorRef]) {
- val userId = p1.getKey
- val userActor = p1.getValue
+ def onRemoval(rn: RemovalNotification[String, ActorRef]) {
+ val userID = rn.getKey
+ val userActor = rn.getValue
- logger.debug("Parking UserActor for userId = %s".format(userId))
+ logger.debug("Parking UserActor for userID = %s".format(userID))
UserActorSupervisor.supervisor.unlink(userActor)
// Check this is received after any currently servicing business logic message.
userActor.stop()
}
}
- def start() {}
+ def start() = {}
def stop() = {
cache.invalidateAll
cache.cleanUp
- };
+ }
- def put(userId: String, userActor: ActorRef): Unit =
- cache.put(userId, userActor)
+ def put(userID: String, userActor: ActorRef): Unit =
+ cache.put(userID, userActor)
def get(userID: String): Option[ActorRef] =
cache.getIfPresent(userID) match {
def stop(): Unit = {
LogHelpers.logStopping(logger)
val (ms0, ms1, _) = TimeHelpers.timed {
- this._serverActor ! PoisonPill
- this._clientActor ! PoisonPill
+ this._serverActor.stop()
+ this._clientActor.stop()
}
LogHelpers.logStopped(logger, ms0, ms1)
}
LogHelpers.logStopped(this.logger, ms0, ms1, fmt, args: _*)
}
- protected def logChainOfCauses(t: Throwable): Unit = {
- logger.error("Oops!\n{}", chainOfCausesForLogging(t))
+ protected def logChainOfCauses(t: Throwable, caughtTraceIndex: Int = 2): Unit = {
+ logger.error("Oops!\n{}", chainOfCausesForLogging(t, caughtTraceIndex + 1))
}
}
import org.junit.Assume._
import gr.grnet.aquarium.LogicTestsAssumptions
import cc.spray.can._
-import akka.actor.{Actor, PoisonPill}
+import akka.actor.Actor
import org.slf4j.LoggerFactory
import akka.config.{Config ⇒ AkkaConfig}
logger.error("Error: %s".format(other))
}
- server ! PoisonPill
- client ! PoisonPill
- service ! PoisonPill
+ server.stop()
+ client.stop()
+ service.stop()
}
Thread sleep 100