Fix for link(..)

This commit is contained in:
Viktor Klang 2010-03-02 00:20:23 +01:00
parent f571c07df2
commit 9cfefa09d6

View file

@ -656,9 +656,9 @@ trait Actor extends TransactionManagement {
* To be invoked from within the actor itself.
*/
protected[this] def link(actor: Actor) = {
getLinkedActors.add(actor)
if (actor._supervisor.isDefined) throw new IllegalStateException(
"Actor can only have one supervisor [" + actor + "], e.g. link(actor) fails")
getLinkedActors.add(actor)
actor._supervisor = Some(this)
Actor.log.debug("Linking actor [%s] to actor [%s]", actor, this)
}