Mercurial > hg > mpdl-group
comparison software/mpdl-services-new/mpiwg-mpdl-cms-web/src/de/mpg/mpiwg/berlin/mpdl/servlets/lt/MpiwgMpdlLtWebServletContextListener.java @ 25:e9fe3186670c default tip
letzter Stand eingecheckt
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 21 May 2013 10:19:32 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
23:e845310098ba | 25:e9fe3186670c |
---|---|
1 package de.mpg.mpiwg.berlin.mpdl.servlets.lt; | |
2 | |
3 import javax.servlet.ServletContext; | |
4 import javax.servlet.ServletContextEvent; | |
5 import javax.servlet.ServletContextListener; | |
6 | |
7 import de.mpg.mpiwg.berlin.mpdl.lt.dict.db.LexHandler; | |
8 import de.mpg.mpiwg.berlin.mpdl.lt.general.Constants; | |
9 import de.mpg.mpiwg.berlin.mpdl.lt.morph.app.MorphologyCache; | |
10 | |
11 public class MpiwgMpdlLtWebServletContextListener implements ServletContextListener { | |
12 private ServletContext context = null; | |
13 | |
14 public void contextInitialized(ServletContextEvent event) { | |
15 try { | |
16 /* | |
17 this.context = event.getServletContext(); | |
18 // String dataDirectory = System.getProperty("catalina.base") + "/webapps/mpiwg-mpdl-lt-web/WEB-INF/data"; | |
19 String dataDirectory = Constants.getInstance().getDataDir(); | |
20 context.setAttribute("dataDirectory", dataDirectory); | |
21 System.out.println(MpiwgMpdlLtWebServletContextListener.class.getName() + ": contextInitialized (data directory= \"" + dataDirectory + "\", set in constants.properties)"); | |
22 MorphologyCache.getInstance(); | |
23 LexHandler.getInstance(); | |
24 */ | |
25 } catch (Exception e) { | |
26 e.printStackTrace(); | |
27 } | |
28 } | |
29 | |
30 public void contextDestroyed(ServletContextEvent event) { | |
31 try { | |
32 /* | |
33 this.context = null; | |
34 LexHandler.getInstance().end(); | |
35 MorphologyCache.getInstance().end(); | |
36 String dataDirectory = Constants.getInstance().getDataDir(); | |
37 System.out.println(MpiwgMpdlLtWebServletContextListener.class.getName() + ": contextDestroyed (databases in directory: \"" + dataDirectory + "\" are closed)"); | |
38 */ | |
39 } catch (Exception e) { | |
40 e.printStackTrace(); | |
41 } | |
42 } | |
43 } |