make it possible to programmatically deploy (e.g. remotely), see #1644

- add Deploy to Props, which is used as the basis (overridden by
  configuration)
- utilize general mechanism .withFallback (introduced on Deploy,
  RouterConfig and Scope)
- actually pass Props over the wire when deploying remotely in order to
  retain settings (this was an oversight before)
- write tests for the new functionality
This commit is contained in:
Roland 2012-01-31 21:19:28 +01:00
parent 9d388f2de6
commit 10974acfe8
19 changed files with 360 additions and 88 deletions

View file

@ -22,6 +22,8 @@ object Props {
final val defaultRoutedProps: RouterConfig = NoRouter
final val defaultDeploy = Deploy()
final val noHotSwap: Stack[Actor.Receive] = Stack.empty
final val empty = new Props(() new Actor { def receive = Actor.emptyBehavior })
@ -105,7 +107,8 @@ object Props {
case class Props(
creator: () Actor = Props.defaultCreator,
dispatcher: String = Dispatchers.DefaultDispatcherId,
routerConfig: RouterConfig = Props.defaultRoutedProps) {
routerConfig: RouterConfig = Props.defaultRoutedProps,
deploy: Deploy = Props.defaultDeploy) {
/**
* No-args constructor that sets all the default values.
@ -159,4 +162,9 @@ case class Props(
* Returns a new Props with the specified router config set.
*/
def withRouter(r: RouterConfig) = copy(routerConfig = r)
/**
* Returns a new Props with the specified deployment configuration.
*/
def withDeploy(d: Deploy) = copy(deploy = d)
}