01: //==============================================================================
02: //===
03: //=== McKoiActivator
04: //===
05: //==============================================================================
06: //=== Copyright (C) 2001-2007 Food and Agriculture Organization of the
07: //=== United Nations (FAO-UN), United Nations World Food Programme (WFP)
08: //=== and United Nations Environment Programme (UNEP)
09: //===
10: //=== This program is free software; you can redistribute it and/or modify
11: //=== it under the terms of the GNU General Public License as published by
12: //=== the Free Software Foundation; either version 2 of the License, or (at
13: //=== your option) any later version.
14: //===
15: //=== This program is distributed in the hope that it will be useful, but
16: //=== WITHOUT ANY WARRANTY; without even the implied warranty of
17: //=== MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18: //=== General Public License for more details.
19: //===
20: //=== You should have received a copy of the GNU General Public License
21: //=== along with this program; if not, write to the Free Software
22: //=== Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23: //===
24: //=== Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
25: //=== Rome - Italy. email: geonetwork@osgeo.org
26: //==============================================================================
27:
28: package org.fao.geonet.activators;
29:
30: import jeeves.interfaces.Activator;
31: import org.fao.geonet.util.McKoiDB;
32: import org.jdom.Element;
33:
34: //==============================================================================
35:
36: public class McKoiActivator implements Activator {
37: private McKoiDB mckoiDB = new McKoiDB();
38:
39: //---------------------------------------------------------------------------
40: //---
41: //--- Activator interface
42: //---
43: //---------------------------------------------------------------------------
44:
45: public void startup(String appPath, Element config)
46: throws Exception {
47: String configFile = config.getChildText("configFile");
48: String address = config.getChildText("address");
49:
50: mckoiDB.setConfigFile(appPath + configFile);
51:
52: if (address != null)
53: mckoiDB.start(address);
54: else
55: mckoiDB.start();
56: }
57:
58: //---------------------------------------------------------------------------
59:
60: public void shutdown() {
61: mckoiDB.stop();
62: }
63: }
64:
65: //==============================================================================
|