public void contextDestroyed(final ServletContextEvent event) {

    PentahoSystem.shutdown();
    if (LocaleHelper.getLocale() == null) {
      LocaleHelper.setLocale(Locale.getDefault());
    }
    // log everything that goes on here
    logger.info(
        Messages.getInstance()
            .getString("SolutionContextListener.INFO_SYSTEM_EXITING")); // $NON-NLS-1$
  }
 public static void shutdownPentahoSystem() {
   PentahoSystem.refreshSettings();
   PentahoSystem.clearGlobals();
   PentahoSystem.clearObjectFactory();
   PentahoSystem.shutdown();
 }