Added a more Java-suitable, and less noisy become method

This commit is contained in:
Viktor Klang 2010-08-17 22:24:40 +02:00
parent b6c782e6f9
commit dfe4d77083

View file

@ -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 ====
// =========================================