⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java~57~

📁 彩信网关程序。只支持发送。
💻 JAVA~57~
字号:
package mmscenter;public class Main extends Engine{  GetNewMmsToPool getNewMmsToPool =null;  SendThread sendThread =null;  ResendThread resendThread =null;  getIniString ini =null;  public Main() {    super("Main");    setDaemon(true);  }  public  boolean ReadIni(){  try{    Config.odbcstring = ini.getString("[LOCALDB]","odbcstring") ;    System.out.println(" 数据库连接驱动 : "+ Config.odbcstring );    Config.db_host=ini.getString("[LOCALDB]","host");     System.out.println(" 数据库IP地址 : "+Config.db_host);    Config.db_name=ini.getString("[LOCALDB]","name");     System.out.println(" 数据库名称 : "+Config.db_name);    Config.db_user=ini.getString("[LOCALDB]","user");     System.out.println(" 数据库用户名 : "+Config.db_user);    Config.db_password=ini.getString("[LOCALDB]","password");     System.out.println(" 数据库密码  : "+Config.db_password );    //万维的认证    Config.user = ini.getString("[MMSCenter]","username");    System.out.println(" 万维网关用户名  : "+Config.user );    Config.password = ini.getString("[MMSCenter]","password");    System.out.println(" 万维网关密码  : "+Config.password );    Config.protocol = ini.getString("[MMSCenter]","protocal");    System.out.println(" MMS包传输协议  : "+Config.protocol );    Config.ip=ini.getString("[MMSCenter]","ip");    System.out.println(" 万维网关IP  : "+Config.ip );    Config.port=ini.getString("[MMSCenter]","port");    System.out.println(" 万维网关开放端口  : "+Config.port );    Config.subfolder=ini.getString("[MMSCenter]","subfolder");    System.out.println(" 万维网关接口路径  : "+Config.subfolder );    return true;  }catch(Exception e){    return false;  }  }  public void run(){    ini = new getIniString();    System.out.println("读入配置文件 : "+ReadIni());    getNewMmsToPool = new GetNewMmsToPool();    sendThread = new SendThread();    resendThread = new ResendThread();    while(true){      System.out.println("<----------监控主线程工作正常---------->");//      System.out.println(Utility.getTimeStr());//      if((Utility.getTimeStr()).startsWith("0000")){//00dian00fen线程重起////        try{//          System.out.println("每天重起线程");//          getNewMmsToPool.shutdown() ;//          System.out.println("getNewMmsToPool线程关闭");//          getNewMmsToPool.nap() ;//          getNewMmsToPool.interrupt() ;//          getNewMmsToPool.startup() ;//          System.out.println("getNewMmsToPool线程重新启动");//          sendThread.shutdown() ;//          System.out.println("sendThread线程关闭");//          sendThread.nap() ;//          sendThread.interrupt() ;//          sendThread.startup() ;//          System.out.println("sendThread线程重新启动");//          resendThread.shutdown();//          System.out.println("resendThread线程关闭");//          resendThread.nap() ;//          resendThread.interrupt() ;//          resendThread.startup() ;//          System.out.println("resendThread线程重新启动");//        }catch(Exception e){//          e.printStackTrace() ;//        };//        try{//          sleep(TimeConfig.TIME_ONE_MINUTE/2);//        }catch(Exception e){//          e.printStackTrace() ;//        }//      }      if(!getNewMmsToPool.isRunning() ||!getNewMmsToPool.isAlive() ){        getNewMmsToPool.startup() ;        System.out.println("getNewMmsToPool线程启动");      }      if(!sendThread.isRunning() || !sendThread.isAlive() ){        sendThread.startup() ;        System.out.println("sendThread线程启动");      }      if(!resendThread.isRunning() || !resendThread.isAlive() ){        resendThread.startup() ;        System.out.println("resendThread线程启动");      }      try{        sleep(TimeConfig.TIME_ONE_MINUTE/2);      }catch(Exception e){        e.printStackTrace() ;      }    }  }  public static void main(String[] args) {    Main main1 = new Main();    main1.startup() ;    while(true){    try{        sleep(TimeConfig.TIME_ONE_MINUTE);      }catch(Exception e){        e.printStackTrace() ;      }    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -