1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package olr;
18
19 import java.io.IOException;
20
21 import olr.rdf.Definitions;
22 import olr.rdf.OLR3Definitions;
23
24 import org.apache.commons.configuration.PropertiesConfiguration;
25 import org.apache.log4j.Logger;
26 import org.apache.torque.Torque;
27
28 import com.lutris.appserver.server.ApplicationException;
29 import com.lutris.appserver.server.StandardApplication;
30 import com.lutris.appserver.server.httpPresentation.HttpPresentationComms;
31 import com.lutris.util.Config;
32
33 /***
34 * @version $Id: Olr.java,v 1.11 2004/08/02 19:01:18 roku Exp $
35 */
36 public final class Olr extends StandardApplication {
37
38 private static final String TORQUE_PROPERTIES_FILENAME = "Torque.properties";
39
40 public void startup(Config appConfig) throws ApplicationException {
41 super.startup(appConfig);
42 Definitions.setValuesFromConfig();
43 OLR3Definitions.setValuesFromConfig();
44
45 try {
46 Olr.initTorque();
47 } catch (Exception e) {
48 throw new ApplicationException(e);
49 }
50 }
51
52 public boolean requestPreprocessor(HttpPresentationComms comms) throws Exception {
53 return super.requestPreprocessor(comms);
54 }
55
56 public static void initTorque() throws Exception {
57
58 try {
59 PropertiesConfiguration config = new PropertiesConfiguration();
60 config.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(
61 TORQUE_PROPERTIES_FILENAME));
62 Torque.init(config);
63 } catch (IOException e) {
64 e.fillInStackTrace();
65 Logger.getLogger(Olr.class).error("Exception setting up torque: " + e);
66 throw new Exception(e.toString());
67 }
68 }
69 }