Closing ticket #460

This commit is contained in:
Viktor Klang 2010-10-25 01:46:42 +02:00
parent ceeaffd091
commit 253f77cc56
2 changed files with 10 additions and 1 deletions

View file

@ -15,6 +15,7 @@ import java.net.InetSocketAddress
import scala.reflect.BeanProperty
import se.scalablesolutions.akka.util. {ReflectiveAccess, Logging, Duration}
import se.scalablesolutions.akka.japi.Procedure
/**
* Implements the Transactor abstraction. E.g. a transactional actor.
@ -44,7 +45,9 @@ abstract class RemoteActor(address: InetSocketAddress) extends Actor {
*/
@serializable sealed trait LifeCycleMessage
case class HotSwap(code: Actor.Receive) extends LifeCycleMessage
case class HotSwap(code: Actor.Receive) extends LifeCycleMessage {
def this(behavior: Procedure[Any]) = this({ case msg => behavior.apply(msg) }: Actor.Receive)
}
case object RevertHotSwap extends LifeCycleMessage

View file

@ -11,6 +11,7 @@ import se.scalablesolutions.akka.config.Supervision._
import java.net.InetSocketAddress
import scala.reflect.BeanProperty
import se.scalablesolutions.akka.japi.Procedure
/**
* Subclass this abstract class to create a MDB-style untyped actor.
@ -67,6 +68,11 @@ abstract class UntypedActor extends Actor {
case msg => onReceive(msg)
}
/**
* Java API for become
*/
def become(behavior: Procedure[Any]): Unit = super.become { case msg => behavior.apply(msg) }
@throws(classOf[Exception])
def onReceive(message: Any): Unit
}