ChildSpec spec = new ChildSpec("myChildActor", ChildMode.TEMPORARY, MAX_RESTARTS,
DURATION, TimeUnit.SECONDS, SHUTDOWN_DEADLINE, myParentActorRef);
sup.addChild(spec);
// Lets examine the identity of the child and the parent.
log.info("Instance {} identity hashCode {}", "myParentActor", System.identityHashCode(sup.getChild("myParentActor")));
log.info("Instance {} identity hashCode {}", "myChildActor", System.identityHashCode(sup.getChild("myChildActor")));
We find the hash code to be exactly the same. And it looks like the the actor name given to the first actor propagates to the child actor. So, if the parent's name is "myParentActor" then the child's name is also "myParentActor". Looking at the code, the name is optional and is not propagated to the child actor. More troubling is the fact that new child actor has the same instance / object identity as the parent.
I am guessing that I may not be using this as intended, or I am missing something? What it the purpose of creating a new actor with - apparently - the same identity as its parent?
Any help clarifying this would be greatly appreciated.
Thanks,
John