| | |
| | | import com.config.AppConfig;
|
| | | import com.del.TmpFileUtil;
|
| | | import com.dev.lock.comm.Lock_ServerSocket_Thread;
|
| | | import com.dev.lock.comm.Lock_Task_SQL;
|
| | | import com.dev.lock.data.ElectLock_Array;
|
| | | import com.dev.lock.history.ElectLock_HistoryData_Record_Thread;
|
| | | import com.sql.MysqlConnPool;
|
| | | import java.sql.Connection;
|
| | | import java.sql.SQLException;
|
| | |
| | | private static Logger logger;
|
| | | private static ElectLock_Array GB_ElLock_Array;
|
| | |
|
| | |
|
| | | |
| | | |
| | | static {
|
| | | System.setProperty("log4j.configurationFile", "log4j2_electlock_dev_x64.xml");
|
| | | }
|
| | | |
| | | public static void main(String[] args) {
|
| | | TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
|
| | | |
| | | GB_ElLock_Array = new ElectLock_Array();
|
| | |
|
| | | logger = LogManager.getLogger(main_ElectLock_Monitor.class);
|
| | |
| | | server_thread.start();
|
| | |
|
| | |
|
| | | {
|
| | | ElectLock_HistoryData_Record_Thread record_thread = new ElectLock_HistoryData_Record_Thread(GB_ElLock_Array, GB_MysqlConnPool);
|
| | | record_thread.start();
|
| | | }
|
| | |
|
| | | //FBS9600_State_SQL.updateProcess_StartTime(GB_MysqlConnPool, m_VersionNum);
|
| | | |
| | | Lock_Task_SQL.updateProcess_StartTime(GB_MysqlConnPool, m_VersionNum);
|
| | | Date last_time = new Date(0);
|
| | | while (true) {
|
| | | try {
|
| | | Thread.sleep(3000L);
|
| | |
|
| | | Date now = new Date();
|
| | | long timelong = (now.getTime()-last_time.getTime())/1000;
|
| | |
| | | TmpFileUtil.delTmpFile();
|
| | | last_time = now;
|
| | | }
|
| | | Thread.sleep(3000L);
|
| | | //FBS9600_State_SQL.updateProcess_ProcessTime(GB_MysqlConnPool); |
| | | } catch (InterruptedException e) {
|
| | | Lock_Task_SQL.updateProcess_ProcessTime(GB_MysqlConnPool); |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
| | | try {
|
| | | Thread.sleep(1000);
|
| | | } catch (InterruptedException e1) {
|
| | | e1.printStackTrace();
|
| | | logger.error(e.toString(),e);
|
| | | }
|
| | | System.out.println(" MySQL not Start ... ");
|
| | | System.out.println(" SQLDataBase Server not Start ... ");
|
| | | } finally {
|
| | | if(conn != null) {
|
| | | try {
|
| | | conn.close();
|
| | | } catch (SQLException e) {
|
| | | e.printStackTrace();
|
| | | logger.error(e.toString(),e);
|
| | | }
|
| | | }
|
| | | }
|