Merge branch 'wip-remote-supervision-rk'

fixing up small issue in Props
This commit is contained in:
Roland 2011-12-13 17:16:28 +01:00
commit dde676927c
74 changed files with 2386 additions and 3427 deletions

View file

@ -8,6 +8,7 @@ import akka.dispatch._
import akka.japi.Creator
import akka.util._
import collection.immutable.Stack
import akka.routing.{ NoRouter, RouterConfig }
/**
* Factory for Props instances.
@ -26,9 +27,12 @@ object Props {
case _: Exception Restart
case _ Escalate
}
final val defaultRoutedProps: RouterConfig = NoRouter
final val defaultFaultHandler: FaultHandlingStrategy = OneForOneStrategy(defaultDecider, None, None)
final val noHotSwap: Stack[Actor.Receive] = Stack.empty
final val empty = Props(new Actor { def receive = Actor.emptyBehavior })
final val empty = new Props(() new Actor { def receive = Actor.emptyBehavior })
/**
* The default Props instance, uses the settings from the Props object starting with default*.
@ -106,7 +110,8 @@ object Props {
case class Props(creator: () Actor = Props.defaultCreator,
@transient dispatcher: MessageDispatcher = Props.defaultDispatcher,
timeout: Timeout = Props.defaultTimeout,
faultHandler: FaultHandlingStrategy = Props.defaultFaultHandler) {
faultHandler: FaultHandlingStrategy = Props.defaultFaultHandler,
routerConfig: RouterConfig = Props.defaultRoutedProps) {
/**
* No-args constructor that sets all the default values.
@ -134,7 +139,8 @@ case class Props(creator: () ⇒ Actor = Props.defaultCreator,
creator = () actorClass.newInstance,
dispatcher = Props.defaultDispatcher,
timeout = Props.defaultTimeout,
faultHandler = Props.defaultFaultHandler)
faultHandler = Props.defaultFaultHandler,
routerConfig = Props.defaultRoutedProps)
/**
* Returns a new Props with the specified creator set.
@ -171,4 +177,10 @@ case class Props(creator: () ⇒ Actor = Props.defaultCreator,
* Java API.
*/
def withFaultHandler(f: FaultHandlingStrategy) = copy(faultHandler = f)
/**
* Returns a new Props with the specified router config set
* Java API
*/
def withRouter(r: RouterConfig) = copy(routerConfig = r)
}