final ServletContext servletContext = event.getServletContext();
// load *all* found config properties
// NOTE: this is presumed to be the first contact point with the config
// instance!
final Config config;
try {
config = Config.load(new ConfigRef(true));
}
catch(final IllegalArgumentException e) {
throw new Error("Unable to load config: " + e.getMessage(), e);
}
// pre dependency injection initializing
log.debug("Performing pre-injection initialization..");
beforeInjection(event);
// load the dependency handler definitions
log.debug("Creating dependency handlers..");
loadDependencyHandlers(servletContext);
final String stage = config.getString("stage", "prod");
log.info("Bootstrapping app [stage: " + stage + "]..");
// create the dependency injector
log.debug("Creating dependency injector..");
final Injector injector = createInjector(servletContext, "dev".equals(stage) ? Stage.DEVELOPMENT : Stage.PRODUCTION, config);