Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumebort committed Feb 17, 2012
1 parent 2fc00af commit 61995ae
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions framework/src/play/src/main/scala/play/core/system/Invoker.scala
Expand Up @@ -22,19 +22,26 @@ object Invoker {
case class GetBodyParser(request: RequestHeader, bodyParser: BodyParser[_])
case class HandleAction[A](request: Request[A], response: Response, action: Action[A], app: Application)

// --

// Call init to register an Actor System properly configured from
// this applicationProvider. Otherwise a default ActorSystem will be created.
def init(applicationProvider: ApplicationProvider) {
val conf = play.api.Play.maybeApplication.filter(_.mode == Mode.Prod).map(app =>
ConfigFactory.load()).getOrElse(Configuration.loadDev(applicationProvider.path))
_system = ActorSystem("play", conf.getConfig("play"))
configuredSystem = ActorSystem("play", conf.getConfig("play"))
promiseInvoker
actionInvoker
}

private var _system: ActorSystem = _
private var configuredSystem: ActorSystem = _

// --

def system = {
Option(_system).getOrElse {
sys.error("Invoker System not initialized")
lazy val system = {
Option(configuredSystem).getOrElse {
Logger.warn("Missing configuration for Play ActorSystem. Starting a default one.")
ActorSystem("play")
}
}

Expand Down

0 comments on commit 61995ae

Please sign in to comment.