private void setupInjector(ServletContext context, Configuration config) { LOGGER.debug("setupInjector"); InjectHelper.inject(this, VisalloBootstrap.bootstrapModuleMaker(config), config); // Store the injector in the context for a servlet to access later context.setAttribute(Injector.class.getName(), InjectHelper.getInjector()); InjectHelper.getInstance(OntologyRepository.class); // verify we are up }
@Override public void contextDestroyed(ServletContextEvent sce) { safeLogInfo("BEGIN: Servlet context destroyed..."); safeLogInfo("Shutdown: SimpleOrmSession"); InjectHelper.getInstance(SimpleOrmSession.class).close(); safeLogInfo("Shutdown: Graph"); InjectHelper.getInstance(Graph.class).shutdown(); safeLogInfo("Shutdown: InjectHelper"); InjectHelper.shutdown(); safeLogInfo("Shutdown: VisalloBootstrap"); VisalloBootstrap.shutdown(); safeLogInfo("END: Servlet context destroyed..."); }