00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 package org.openmobileis.services.servlet;
00027
00028 import java.io.File;
00029 import java.util.Properties;
00030
00031 import org.openmobileis.common.intl.IntlResourceManager;
00032 import org.openmobileis.common.util.PropertiesManager;
00033 import org.openmobileis.common.util.exception.ServiceException;
00034 import org.openmobileis.common.util.log.FileOpenCloseLogManager;
00035 import org.openmobileis.common.util.log.LogManager;
00036 import org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDBManager;
00037 import org.openmobileis.services.servlet.OpenMISInit;
00038
00039 public class SimpleOpenMISInit implements OpenMISInit {
00040
00041 public SimpleOpenMISInit() {
00042 super();
00043 }
00044
00045 public void preLoadingInit() throws ServiceException {
00046
00047
00048
00049 Properties props = new Properties();
00050 props.put("org.openmobileis.common.log.file", System.getProperty("user.dir")+"/WEB-INF/log/openmislog.txt");
00051 File file = new File(System.getProperty("user.dir")+"/WEB-INF/log");
00052 if (file.exists()) FileOpenCloseLogManager.registerLogManager(props);
00053 else LogManager.registerLogManager(null);
00054
00055
00056 PropertiesManager.getManager().addProperty("fastobjectdb.database.path", System.getProperty("user.dir")+"/database");
00057 PropertiesManager.getManager().addProperty("fastobjectdb.database.name", "db");
00058
00059
00060 try {
00061 String locale = IntlResourceManager.getManager().getSystemDefaultLocale();
00062 IntlResourceManager.getManager().addLocalizedProperties(System.getProperty("user.dir")+"/WEB-INF/conf/properties/systemmessages.properties", locale);
00063 } catch (Throwable ex) {
00064 LogManager.traceError(0, ex);
00065 }
00066
00067
00068 PropertiesManager.getManager().addProperty("org.openmobileis.synchro.client.openmsp.numsyncpropsfile",System.getProperty("user.dir") + "/WEB-INF/conf/numsync.txt");
00069 try {
00070 SynchroFastObjectDBManager.getCurrentFODB();
00071 } catch (Throwable ex) {
00072 throw new ServiceException(ex);
00073 }
00074
00075 }
00076
00077 public void postLoadingInit() throws ServiceException {
00078 }
00079
00080 }