From dfe4d77083116fca129786b2a60340b9e435b181 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 17 Aug 2010 22:24:40 +0200 Subject: [PATCH] Added a more Java-suitable, and less noisy become method --- akka-core/src/main/scala/actor/Actor.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/akka-core/src/main/scala/actor/Actor.scala b/akka-core/src/main/scala/actor/Actor.scala index 6dbf57c557..1f669c9e32 100644 --- a/akka-core/src/main/scala/actor/Actor.scala +++ b/akka-core/src/main/scala/actor/Actor.scala @@ -448,13 +448,21 @@ trait Actor extends Logging { def isDefinedAt(message: Any): Boolean = processingBehavior.isDefinedAt(message) /** One of the fundamental methods of the ActorsModel - * Actor assumes a new behavior + * Actor assumes a new behavior, + * None reverts the current behavior to the original behavior */ def become(behavior: Option[Receive]) { self.hotswap = behavior self.checkReceiveTimeout // FIXME : how to reschedule receivetimeout on hotswap? } + /** Akka Java API + * One of the fundamental methods of the ActorsModel + * Actor assumes a new behavior, + * null reverts the current behavior to the original behavior + */ + def become(behavior: Receive): Unit = become(Option(behavior)) + // ========================================= // ==== INTERNAL IMPLEMENTATION DETAILS ==== // =========================================