/** * The context for loading an application. * * @param environment the application environment * @param initialSettings 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 Context(Environment environment, Map<String, Object> initialSettings) { this.underlying = new play.api.ApplicationLoader.Context( environment.asScala(), play.api.Configuration.load(environment.asScala(), play.libs.Scala.asScala(initialSettings)), new DefaultApplicationLifecycle(), scala.Option.empty()); }
/** * Create a new context with a different configuration. * * @param initialConfiguration the configuration to use in the created context * @return the created context */ public Context withConfig(Config initialConfiguration) { play.api.ApplicationLoader.Context scalaContext = new play.api.ApplicationLoader.Context( underlying.environment(), new play.api.Configuration(initialConfiguration), new DefaultApplicationLifecycle(), underlying.devContext()); return new Context(scalaContext); } }
/** * Create a new context with a different environment. * * @param environment the environment this context should use * @return a context using the specified environment */ public Context withEnvironment(Environment environment) { play.api.ApplicationLoader.Context scalaContext = new play.api.ApplicationLoader.Context( environment.asScala(), underlying.initialConfiguration(), new DefaultApplicationLifecycle(), underlying.devContext()); return new Context(scalaContext); }
/** * The context for loading an application. * * @param environment the application environment * @param initialSettings 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 Context(Environment environment, Map<String, Object> initialSettings) { this.underlying = new play.api.ApplicationLoader.Context( environment.asScala(), play.api.Configuration.load(environment.asScala(), play.libs.Scala.asScala(initialSettings)), new DefaultApplicationLifecycle(), scala.Option.empty()); }
/** * Create a new context with a different configuration. * * @param initialConfiguration the configuration to use in the created context * @return the created context */ public Context withConfig(Config initialConfiguration) { play.api.ApplicationLoader.Context scalaContext = new play.api.ApplicationLoader.Context( underlying.environment(), new play.api.Configuration(initialConfiguration), new DefaultApplicationLifecycle(), underlying.devContext()); return new Context(scalaContext); } }
/** * The context for loading an application. * * @param environment the application environment * @param initialSettings 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 Context(Environment environment, Map<String, Object> initialSettings) { this.underlying = new play.api.ApplicationLoader.Context( environment.asScala(), play.api.Configuration.load(environment.asScala(), play.libs.Scala.asScala(initialSettings)), new DefaultApplicationLifecycle(), scala.Option.empty()); }
/** * Create a new context with a different environment. * * @param environment the environment this context should use * @return a context using the specified environment */ public Context withEnvironment(Environment environment) { play.api.ApplicationLoader.Context scalaContext = new play.api.ApplicationLoader.Context( environment.asScala(), underlying.initialConfiguration(), new DefaultApplicationLifecycle(), underlying.devContext()); return new Context(scalaContext); }
/** * Create a new context with a different environment. * * @param environment the environment this context should use * @return a context using the specified environment */ public Context withEnvironment(Environment environment) { play.api.ApplicationLoader.Context scalaContext = new play.api.ApplicationLoader.Context( environment.asScala(), underlying.initialConfiguration(), new DefaultApplicationLifecycle(), underlying.devContext()); return new Context(scalaContext); }
/** * The context for loading an application. * * @param environment the application environment * @param initialSettings 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 Context(Environment environment, Map<String,Object> initialSettings) { this.underlying = new play.api.ApplicationLoader.Context( environment.underlying(), scala.Option.empty(), new play.core.DefaultWebCommands(), play.api.Configuration.load(environment.underlying(), play.libs.Scala.asScala(initialSettings))); }
/** * Get the application lifecycle from the context. * * @return the application lifecycle */ public ApplicationLifecycle applicationLifecycle() { return underlying.lifecycle().asJava(); }
/** * If an application is loaded in dev mode then this additional context is available. * * @return optional with the value if the application is running in dev mode or empty otherwise. */ public Optional<play.api.ApplicationLoader.DevContext> devContext() { return OptionConverters.toJava(underlying.devContext()); }
/** * If an application is loaded in dev mode then this additional context is available. * * @return optional with the value if the application is running in dev mode or empty otherwise. */ public Optional<play.api.ApplicationLoader.DevContext> devContext() { return OptionConverters.toJava(underlying.devContext()); }
/** * Get the environment from the context. */ public Environment environment() { return new Environment(underlying.environment()); }
/** * Get the application lifecycle from the context. * * @return the application lifecycle */ public ApplicationLifecycle applicationLifecycle() { return underlying.lifecycle().asJava(); }
/** * Get the configuration from the context. This configuration is not necessarily the same * configuration used by the application, as the ApplicationLoader may, through it's own * mechanisms, modify it or completely ignore it. */ public Configuration initialConfiguration() { return new Configuration(underlying.initialConfiguration()); }
/** * Create a new context with a different configuration. * * @param initialConfiguration the configuration to use in the created context * @return the created context */ public Context withConfig(Config initialConfiguration) { play.api.ApplicationLoader.Context scalaContext = new play.api.ApplicationLoader.Context( underlying.environment(), new play.api.Configuration(initialConfiguration), new DefaultApplicationLifecycle(), underlying.devContext()); return new Context(scalaContext); } }
/** * Get the configuration from the context. This configuration is not necessarily the same * configuration used by the application, as the ApplicationLoader may, through it's own * mechanisms, modify it or completely ignore it. * * @return the initial configuration */ public Config initialConfig() { return underlying.initialConfiguration().underlying(); }
/** * Get the configuration from the context. This configuration is not necessarily the same * configuration used by the application, as the ApplicationLoader may, through it's own * mechanisms, modify it or completely ignore it. * * @return the initial configuration */ public Config initialConfig() { return underlying.initialConfiguration().underlying(); }
/** * Get the environment from the context. * * @return the environment */ public Environment environment() { return new Environment(underlying.environment()); }
/** * Get the application lifecycle from the context. * * @return the application lifecycle */ public ApplicationLifecycle applicationLifecycle() { return underlying.lifecycle().asJava(); }