Package ninja.standalone
Interface Console<T extends Console>
-
- All Known Subinterfaces:
Standalone<T>
- All Known Implementing Classes:
AbstractConsole
,AbstractStandalone
,NinjaConsole
public interface Console<T extends Console>
- Author:
- jjlauer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
configure()
Configures the standalone to prepare for being started.T
externalConfigurationPath(String externalConfigurationPath)
Optional<String>
getExternalConfigurationPath()
com.google.inject.Injector
getInjector()
Gets the Guice injector that booted the Ninja application.String
getName()
NinjaMode
getNinjaMode()
NinjaPropertiesImpl
getNinjaProperties()
Gets the NinjaProperties that were used to configure Ninja.T
name(String name)
T
ninjaMode(NinjaMode ninjaMode)
T
overrideModule(com.google.inject.Module module)
Override Guice module bindings as described here: https://google.github.io/guice/api-docs/3.0/javadoc/com/google/inject/util/Modules.htmlT
overrideProperties(Map<String,String> properties)
Override specific properties programmatically.T
shutdown()
Shutdown Ninja and underlying server as safely as possible (tries not to cause exceptions to be thrown).T
start()
Configures (if not yet done), boots Ninja application and starts the underlying server.
-
-
-
Method Detail
-
configure
T configure() throws Exception
Configures the standalone to prepare for being started.- Returns:
- This standalone
- Throws:
Exception
- Thrown if an exception occurs during configuration
-
getInjector
com.google.inject.Injector getInjector()
Gets the Guice injector that booted the Ninja application. This value is only accessible after start() is successfully called.- Returns:
- The guice injector
- Throws:
IllegalStateException
- Thrown if attempting to access this variable before start() is successfully called.
-
getName
String getName()
-
getNinjaMode
NinjaMode getNinjaMode()
-
getNinjaProperties
NinjaPropertiesImpl getNinjaProperties()
Gets the NinjaProperties that were used to configure Ninja. This value is only accessible after configure() is successfully called.- Returns:
- The NinjaProperties implementation
- Throws:
IllegalStateException
- Thrown if attempting to access this variable before configure() is successfully called.
-
overrideModule
T overrideModule(com.google.inject.Module module)
Override Guice module bindings as described here: https://google.github.io/guice/api-docs/3.0/javadoc/com/google/inject/util/Modules.html- Parameters:
module
- Any bindings in this bindings will override all other bindings. This is very useful in tests.- Returns:
- this instance for chaining
-
overrideProperties
T overrideProperties(Map<String,String> properties)
Override specific properties programmatically.- Parameters:
properties
- Any properties in this map will override properties in any configuration file. This is very useful in tests.- Returns:
- this instance for chaining
-
shutdown
T shutdown()
Shutdown Ninja and underlying server as safely as possible (tries not to cause exceptions to be thrown).- Returns:
- This standalone
-
-