import gr.grnet.aquarium.util.date.TimeHelpers
import com.ckkloverdos.maybe.{Failed, NoVal, Just}
import gr.grnet.aquarium.logic.accounting.RoleAgreements
+import gr.grnet.aquarium.messaging.AkkaAMQP
/**
*/
class UserActor extends AquariumActor
+ with AkkaAMQP
with ReflectiveAquariumActor
with Loggable {
@volatile
@volatile
private[this] var _timestampTheshold: Long = _
+ private[this] lazy val messenger = producer("aquarium")
+
def role = UserActorRole
private[this] def _configurator: Configurator = Configurator.MasterConfigurator
DEBUG("New active status = %s".format(newActive))
- this._userState = this._userState.copy( activeStateSnapshot = newActive )
+ this._userState = this._userState.copy(activeStateSnapshot = newActive)
}
def onProcessUserEvent(event: ProcessUserEvent): Unit = {
if(userEvent.userID != this._userId) {
ERROR("Received %s but my userId = %s".format(userEvent, this._userId))
} else {
-// ensureUserState()
if(userEvent.isCreateUser) {
processCreateUser(userEvent)
} else if(userEvent.isModifyUser) {
override def postStop {
DEBUG("Stopping, saving state")
- //saveUserState
+ saveUserState
+ }
+
+ override def preRestart(reason: Throwable) {
+ DEBUG("Actor failed, restarting")
+ }
+
+ override def postRestart(reason: Throwable) {
+ DEBUG("Actor restarted succesfully")
}
def knownMessageTypes = UserActor.KnownMessageTypes