public static final class ApplicationLoader.Context
extends java.lang.Object
Constructor and Description |
---|
Context(play.api.ApplicationLoader.Context underlying)
The context for loading an application.
|
Context(Environment environment)
The context for loading an application.
|
Context(Environment environment,
java.util.Map<java.lang.String,java.lang.Object> initialSettings)
The context for loading an application.
|
Modifier and Type | Method and Description |
---|---|
ApplicationLifecycle |
applicationLifecycle()
Get the application lifecycle from the context.
|
play.api.ApplicationLoader.Context |
asScala()
Get the wrapped Scala context.
|
java.util.Optional<play.api.ApplicationLoader.DevContext> |
devContext()
If an application is loaded in dev mode then this additional context is available.
|
Environment |
environment()
Get the environment from the context.
|
com.typesafe.config.Config |
initialConfig()
Get the configuration from the context.
|
java.util.Optional<play.core.SourceMapper> |
sourceMapper()
Deprecated.
Deprecated as of 2.7.0. Access it using
devContext() . |
ApplicationLoader.Context |
withConfig(com.typesafe.config.Config initialConfiguration)
Create a new context with a different configuration.
|
ApplicationLoader.Context |
withEnvironment(Environment environment)
Create a new context with a different environment.
|
public Context(play.api.ApplicationLoader.Context underlying)
underlying
- The Scala context that is being wrapped.public Context(Environment environment)
environment
- the application environmentpublic Context(Environment environment, java.util.Map<java.lang.String,java.lang.Object> initialSettings)
environment
- the application environmentinitialSettings
- the initial settings. These settings are merged with the settings from
the loaded configuration files, and together form the initialConfiguration provided by
the context. It is intended for use in dev mode, to allow the build system to pass
additional configuration into the application.public play.api.ApplicationLoader.Context asScala()
public Environment environment()
public com.typesafe.config.Config initialConfig()
public ApplicationLifecycle applicationLifecycle()
public java.util.Optional<play.api.ApplicationLoader.DevContext> devContext()
@Deprecated public java.util.Optional<play.core.SourceMapper> sourceMapper()
devContext()
.public ApplicationLoader.Context withEnvironment(Environment environment)
environment
- the environment this context should usepublic ApplicationLoader.Context withConfig(com.typesafe.config.Config initialConfiguration)
initialConfiguration
- the configuration to use in the created context