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
25
26
27
28
29
30
31
32 public class DocumentStoreContextListner implements ServletContextListener {
33
34 @Override
35 public void contextInitialized(ServletContextEvent sce) {
36 try {
37 DocStoreSettingsUtil.getInstance().copyResources();
38 } catch (Exception e) {
39 e.printStackTrace();
40 }
41 DocStoreCamelContext.getInstance();
42 }
43
44 @Override
45 public void contextDestroyed(ServletContextEvent sce) {
46
47 DocStoreCamelContext.getInstance().stop();
48 new DocumentStoreService().shutdownRepository();
49 }
50 }