diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala index d69a4e3b45..05473f0f6e 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala @@ -78,7 +78,7 @@ object ActorModelSpec { case Increment(count) ⇒ ack; count.incrementAndGet(); busy.switchOff() case CountDownNStop(l) ⇒ ack; l.countDown(); self.stop(); busy.switchOff() case Restart ⇒ ack; busy.switchOff(); throw new Exception("Restart requested") - case Interrupt ⇒ ack; busy.switchOff(); throw new InterruptedException("Ping!") + case Interrupt ⇒ ack; sender ! Status.Failure(new ActorInterruptedException(new InterruptedException("Ping!"))); busy.switchOff(); throw new InterruptedException("Ping!") case ThrowException(e: Throwable) ⇒ ack; busy.switchOff(); throw e } } @@ -379,26 +379,17 @@ abstract class ActorModelSpec extends AkkaSpec { val a = newTestActor(dispatcher) val f1 = a ? Reply("foo") val f2 = a ? Reply("bar") - val f3 = try { - a ? Interrupt - } catch { - // CallingThreadDispatcher throws IE directly - case ie: InterruptedException ⇒ new KeptPromise(Left(ActorInterruptedException(ie))) - } + val f3 = try { a ? Interrupt } catch { case ie: InterruptedException ⇒ new KeptPromise(Left(ActorInterruptedException(ie))) } val f4 = a ? Reply("foo2") - val f5 = try { - a ? Interrupt - } catch { - case ie: InterruptedException ⇒ new KeptPromise(Left(ActorInterruptedException(ie))) - } + val f5 = try { a ? Interrupt } catch { case ie: InterruptedException ⇒ new KeptPromise(Left(ActorInterruptedException(ie))) } val f6 = a ? Reply("bar2") assert(f1.get === "foo") assert(f2.get === "bar") assert(f4.get === "foo2") - assert(f3.value === None) + assert(intercept[ActorInterruptedException](f3.get).getMessage === "Ping!") assert(f6.get === "bar2") - assert(f5.value === None) + assert(intercept[ActorInterruptedException](f5.get).getMessage === "Ping!") } } diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 32248ef6a7..4bc406a226 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -41,7 +41,7 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider private val remoteDaemonConnectionManager = new RemoteConnectionManager(app, remote) private[akka] def theOneWhoWalksTheBubblesOfSpaceTime: ActorRef = local.theOneWhoWalksTheBubblesOfSpaceTime - private[akka] def terminationFuture = new DefaultPromise[AkkaApplication.ExitStatus](Timeout.never)(app.dispatcher) + private[akka] def terminationFuture = local.terminationFuture def defaultDispatcher = app.dispatcher def defaultTimeout = app.AkkaConfig.ActorTimeout diff --git a/akka-stm/src/main/scala/akka/agent/Agent.scala b/akka-stm/src/main/scala/akka/agent/Agent.scala index c2d0e1b485..720059b49b 100644 --- a/akka-stm/src/main/scala/akka/agent/Agent.scala +++ b/akka-stm/src/main/scala/akka/agent/Agent.scala @@ -125,9 +125,7 @@ class Agent[T](initialValue: T, app: AkkaApplication) { if (Stm.activeTransaction) { val result = new DefaultPromise[T](timeout)(app.dispatcher) get //Join xa - deferred { - result completeWith dispatch - } //Attach deferred-block to current transaction + deferred { result completeWith dispatch } //Attach deferred-block to current transaction result } else dispatch } @@ -288,7 +286,7 @@ class AgentUpdater[T](agent: Agent[T]) extends Actor { def receive = { case update: Update[_] ⇒ sender.tell(atomic(txFactory) { agent.ref alter update.function.asInstanceOf[T ⇒ T] }) - case Get ⇒ sender ! agent.get + case Get ⇒ sender.tell(agent.get) case _ ⇒ } }