DOC: Updated preRestart

This commit is contained in:
Patrik Nordwall 2011-12-14 19:25:32 +01:00
parent 9ad2580ea2
commit 6bbbceaf6c
3 changed files with 45 additions and 41 deletions

View file

@ -78,8 +78,7 @@ public class UntypedActorTestBase {
ActorSystem system = ActorSystem.create("MySystem");
//#creating-props
MessageDispatcher dispatcher = system.dispatcherFactory().lookup("my-dispatcher");
ActorRef myActor = system.actorOf(
new Props().withCreator(MyUntypedActor.class).withDispatcher(dispatcher),
ActorRef myActor = system.actorOf(new Props().withCreator(MyUntypedActor.class).withDispatcher(dispatcher),
"myactor");
//#creating-props
myActor.tell("test");
@ -166,6 +165,8 @@ public class UntypedActorTestBase {
}
public void preRestart(Throwable reason, Option<Object> message) {
for (ActorRef each : getContext().getChildren())
getContext().stop(each);
postStop();
}