make Terminated constr private[akka]
This commit is contained in:
parent
8827536cc2
commit
c03665ec46
3 changed files with 9 additions and 7 deletions
|
|
@ -63,7 +63,7 @@ case object Kill extends Kill {
|
|||
* When Death Watch is used, the watcher will receive a Terminated(watched) message when watched is terminated.
|
||||
*/
|
||||
@SerialVersionUID(1L)
|
||||
case class Terminated(@BeanProperty actor: ActorRef)(
|
||||
case class Terminated private[akka] (@BeanProperty actor: ActorRef)(
|
||||
@BeanProperty val existenceConfirmed: Boolean,
|
||||
private[akka] val uid: Int)
|
||||
extends AutoReceivedMessage
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ public class FaultHandlingTestBase {
|
|||
final TestProbe probe = new TestProbe(system);
|
||||
probe.watch(child);
|
||||
child.tell(new IllegalArgumentException());
|
||||
probe.expectMsg(new Terminated(child, true, 0));
|
||||
probe.expectMsgClass(Terminated.class);
|
||||
//#stop
|
||||
|
||||
//#escalate-kill
|
||||
|
|
@ -190,7 +190,7 @@ public class FaultHandlingTestBase {
|
|||
probe.watch(child);
|
||||
assert Await.result(ask(child, "get", 5000), timeout).equals(0);
|
||||
child.tell(new Exception());
|
||||
probe.expectMsg(new Terminated(child, true, 0));
|
||||
probe.expectMsgClass(Terminated.class);
|
||||
//#escalate-kill
|
||||
|
||||
//#escalate-restart
|
||||
|
|
|
|||
|
|
@ -113,8 +113,9 @@ class FaultHandlingDocSpec extends AkkaSpec with ImplicitSender {
|
|||
//#stop
|
||||
watch(child) // have testActor watch “child”
|
||||
child ! new IllegalArgumentException // break it
|
||||
val t = expectMsg(Terminated(child)(true, 0))
|
||||
t.existenceConfirmed must be(true)
|
||||
expectMsgPF() {
|
||||
case t @ Terminated(`child`) if t.existenceConfirmed ⇒ ()
|
||||
}
|
||||
child.isTerminated must be(true)
|
||||
//#stop
|
||||
}
|
||||
|
|
@ -128,8 +129,9 @@ class FaultHandlingDocSpec extends AkkaSpec with ImplicitSender {
|
|||
expectMsg(0)
|
||||
|
||||
child2 ! new Exception("CRASH") // escalate failure
|
||||
val t = expectMsg(Terminated(child2)(true, 0))
|
||||
t.existenceConfirmed must be(true)
|
||||
expectMsgPF() {
|
||||
case t @ Terminated(`child2`) if t.existenceConfirmed ⇒ ()
|
||||
}
|
||||
//#escalate-kill
|
||||
//#escalate-restart
|
||||
val supervisor2 = system.actorOf(Props[Supervisor2], "supervisor2")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue