From Buff Lemur, 10 Years ago, written in Plain Text.
Embed
  1.  
  2.     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
  3.         System.out.println("*********************");
  4.         Logger.getRootLogger().removeAllAppenders();
  5.         BasicConfigurator.configure();
  6.  
  7.         registerShutdownHook();
  8.  
  9.         /* Load config */
  10.         try {
  11.             File configFile = new File(getServletContext().getRealPath(CONFIG_PATH));
  12.             Properties props = new Properties();
  13.             props.load(new FileReader(configFile));
  14.             props.load(new FileReader(configFile));
  15.  
  16.             ProcessingQueue.getInstance().configure(props);
  17.  
  18.             /* Start all processing threads */
  19.             for (Runnable runnable : ProcessingQueue.getInstance().getRunnables()) {
  20.                 Thread thread = ThreadManager.createBackgroundThread(runnable);
  21.                 thread.start();
  22.             }
  23.  
  24.         } catch (Exception e) {
  25.             throw new IOException("Could not create processing threads", e);
  26.         }
  27.         logger.info("App started");
  28.     }