1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.web;
17
18 import javax.servlet.ServletContextEvent;
19 import javax.servlet.ServletContextListener;
20
21 import org.kuali.ole.docstore.process.DocStoreCamelContext;
22 import org.kuali.ole.docstore.utility.DocStoreSettingsUtil;
23 import org.kuali.ole.service.DocumentStoreService;
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
26
27
28
29
30
31
32
33
34 public class DocumentStoreContextListner implements ServletContextListener {
35 private Logger logger = LoggerFactory.getLogger(DocumentStoreContextListner.class);
36 @Override
37 public void contextInitialized(ServletContextEvent sce) {
38 try {
39 DocStoreSettingsUtil.getInstance().copyResources();
40 } catch (Exception e) {
41 logger.error(e.getMessage() , e);
42 }
43 DocStoreCamelContext.getInstance();
44 }
45
46 @Override
47 public void contextDestroyed(ServletContextEvent sce) {
48
49 DocStoreCamelContext.getInstance().stop();
50 new DocumentStoreService().shutdownRepository();
51 }
52 }