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.FastObjectDBManager;
00037 import org.openmobileis.database.fastobjectdb.synchro.client.SynchroFastObjectDBManager;
00038 import org.openmobileis.services.servlet.OpenMISInit;
00039
00040 public class SimpleOpenMISInit implements OpenMISInit {
00041
00042 public SimpleOpenMISInit() {
00043 super();
00044 }
00045
00046 public void preLoadingInit() throws ServiceException {
00047
00048
00049
00050 Properties props = new Properties();
00051 props.put("org.openmobileis.common.log.file", System.getProperty("user.dir")+"/WEB-INF/log/openmislog.txt");
00052 File file = new File(System.getProperty("user.dir")+"/WEB-INF/log");
00053 if (file.exists()) FileOpenCloseLogManager.registerLogManager(props);
00054 else LogManager.registerLogManager(null);
00055
00056
00057 PropertiesManager.getManager().addProperty("fastobjectdb.database.path", System.getProperty("user.dir")+"/database");
00058 PropertiesManager.getManager().addProperty("fastobjectdb.database.name", "db");
00059
00060
00061 try {
00062 String locale = IntlResourceManager.getManager().getSystemDefaultLocale();
00063 IntlResourceManager.getManager().addLocalizedProperties(System.getProperty("user.dir")+"/WEB-INF/conf/properties/systemmessages.properties", locale);
00064 } catch (Throwable ex) {
00065 LogManager.traceError(0, ex);
00066 }
00067
00068
00069 PropertiesManager.getManager().addProperty("org.openmobileis.synchro.client.openmsp.numsyncpropsfile",System.getProperty("user.dir") + "/WEB-INF/conf/numsync.txt");
00070 try {
00071 FastObjectDBManager.registerManager(new SynchroFastObjectDBManager());
00072 } catch (Throwable ex) {
00073 throw new ServiceException(ex);
00074 }
00075
00076 }
00077
00078 public void postLoadingInit() throws ServiceException {
00079 }
00080
00081 }