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