diff options
Diffstat (limited to 'src/actors-migration/scala/actors/migration/StashingActor.scala')
-rw-r--r-- | src/actors-migration/scala/actors/migration/StashingActor.scala | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/actors-migration/scala/actors/migration/StashingActor.scala b/src/actors-migration/scala/actors/migration/StashingActor.scala index 9c3917b65e..12bad2ed1c 100644 --- a/src/actors-migration/scala/actors/migration/StashingActor.scala +++ b/src/actors-migration/scala/actors/migration/StashingActor.scala @@ -13,12 +13,12 @@ object StashingActor extends Combinators { } } -@deprecated("Scala Actors are being removed from the standard library. Please refer to the migration guide.", "2.10") +@deprecated("Scala Actors are being removed from the standard library. Please refer to the migration guide.", "2.10.0") trait StashingActor extends InternalActor { type Receive = PartialFunction[Any, Unit] // checks if StashingActor is created within the actorOf block - creationCheck; + creationCheck() private[actors] val ref = new InternalActorRef(this) @@ -110,19 +110,18 @@ trait StashingActor extends InternalActor { private[actors] var behaviorStack = immutable.Stack[PartialFunction[Any, Unit]]() /* - * Checks that StashingActor can be created only by MigrationSystem.actorOf method. + * Checks that StashingActor instances can only be created using the ActorDSL. */ - private[this] def creationCheck = { - + private[this] def creationCheck(): Unit = { // creation check (see ActorRef) - val context = MigrationSystem.contextStack.get + val context = ActorDSL.contextStack.get if (context.isEmpty) - throw new RuntimeException("In order to create StashingActor one must use actorOf.") + throw new RuntimeException("In order to create a StashingActor one must use the ActorDSL object") else { if (!context.head) - throw new RuntimeException("Only one actor can be created per actorOf call.") + throw new RuntimeException("Cannot create more than one actor") else - MigrationSystem.contextStack.set(context.push(false)) + ActorDSL.contextStack.set(context.push(false)) } } |