Package ninja
Class Bootstrap
- java.lang.Object
-
- ninja.Bootstrap
-
- Direct Known Subclasses:
NinjaConsole.ConsoleBootstrap
public class Bootstrap extends Object
Bootstrap for a Ninja application. Assists with initializing logging, configuring Guice injector, applying user-defined Guice modules/bindings, creates the injector, and compiles the routes. Subclasses will likely want to provide an inherited configure() method that adds modules specific to the subclassed Bootstrap. See ninja-servlet and NinjaServletContext for an example of a subclass.
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_GUICE_MODULE_CONVENTION_LOCATION
static String
APPLICATION_GUICE_SERVLET_MODULE_CONVENTION_LOCATION
static String
NINJA_CONVENTION_LOCATION
protected NinjaBaseDirectoryResolver
ninjaBaseDirectoryResolver
static String
ROUTES_CONVENTION_LOCATION
-
Constructor Summary
Constructors Constructor Description Bootstrap(NinjaPropertiesImpl ninjaProperties)
Bootstrap(NinjaPropertiesImpl ninjaProperties, Optional<com.google.inject.Module> overrideModuleOpt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModule(com.google.inject.Module module)
void
boot()
protected void
configure()
com.google.inject.Injector
getInjector()
void
initRoutes()
void
shutdown()
-
-
-
Field Detail
-
APPLICATION_GUICE_MODULE_CONVENTION_LOCATION
public static final String APPLICATION_GUICE_MODULE_CONVENTION_LOCATION
- See Also:
- Constant Field Values
-
APPLICATION_GUICE_SERVLET_MODULE_CONVENTION_LOCATION
public static final String APPLICATION_GUICE_SERVLET_MODULE_CONVENTION_LOCATION
- See Also:
- Constant Field Values
-
ROUTES_CONVENTION_LOCATION
public static final String ROUTES_CONVENTION_LOCATION
- See Also:
- Constant Field Values
-
NINJA_CONVENTION_LOCATION
public static final String NINJA_CONVENTION_LOCATION
- See Also:
- Constant Field Values
-
ninjaBaseDirectoryResolver
protected final NinjaBaseDirectoryResolver ninjaBaseDirectoryResolver
-
-
Constructor Detail
-
Bootstrap
public Bootstrap(NinjaPropertiesImpl ninjaProperties)
-
Bootstrap
public Bootstrap(NinjaPropertiesImpl ninjaProperties, Optional<com.google.inject.Module> overrideModuleOpt)
-
-