Application

play.api.Application
See theApplication companion object
trait Application

A Play application.

Application creation is handled by the framework engine.

If you need to create an ad-hoc application, for example in case of unit testing, you can easily achieve this using:

val application = new DefaultApplication(new File("."), this.getClass.getClassloader, None, Play.Mode.Dev)

This will create an application using the current classloader.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

The default ActorSystem used by the application.

The default ActorSystem used by the application.

Attributes

def classloader: ClassLoader

The application's classloader

The application's classloader

Attributes

The default CoordinatedShutdown to stop the Application

The default CoordinatedShutdown to stop the Application

Attributes

The application's environment

The application's environment

Attributes

The HTTP error handler

The HTTP error handler

Attributes

def path: File

The absolute path hosting this application, mainly used by the getFile(path) helper method

The absolute path hosting this application, mainly used by the getFile(path) helper method

Attributes

The factory used to create requests for this application.

The factory used to create requests for this application.

Attributes

The HTTP request handler

The HTTP request handler

Attributes

def stop(): Future[_]

Stop the application. The returned future will be redeemed when all stop hooks have been run.

Stop the application. The returned future will be redeemed when all stop hooks have been run.

Attributes

Concrete methods

def asJava: Application

Return the application as a Java application.

Return the application as a Java application.

Attributes

Get the runtime injector for this application. In a runtime dependency injection based application, this can be used to obtain components as bound by the DI framework.

Get the runtime injector for this application. In a runtime dependency injection based application, this can be used to obtain components as bound by the DI framework.

Attributes

Returns

The injector.

def mode: Mode

Dev, Prod or Test

Dev, Prod or Test

Attributes

Concrete fields

Returns true if the global application is enabled for this app. If set to false, this changes the behavior of Play.start to disallow access to the global application instance, also affecting the deprecated Play APIs that use these.

Returns true if the global application is enabled for this app. If set to false, this changes the behavior of Play.start to disallow access to the global application instance, also affecting the deprecated Play APIs that use these.

Attributes

Implicits

Implicits

implicit def materializer: Materializer

The default Materializer used by the application.

The default Materializer used by the application.

Attributes